threads / patch / 2504

patch, 4 partsFix a typo in the "add" command's documentation

Subject: [PATCH 4/4] Fix a typo in the "add" command's documentation

## tl;dr

5 messages between Nov 14, 2005 and Nov 14, 2005. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Chuck Lever· Nov 14, 2005, 16:50 UTC · lore

[PATCH 0/4] StGIT minor clean ups

A few minor typos and additional error checking.
        -- Chuck Lever
--
corporate:    <cel at netapp dot com>
personal:     <chucklever at bigfoot dot com>
Chuck Lever· Nov 14, 2005, 16:50 UTC · re: Chuck Lever · lore

[PATCH 1/4] Better error message when renaming patches to same name

Generate a more precise error message when trying to rename a patch to the same name. This is what we get currently:

  [cel@dexter main]$ stg rename nfs_direct_wait nfs_direct_wait
  Renaming patch "nfs_direct_wait" -> "nfs_direct_wait"...stg rename: Patch
  "nfs_direct_wait" already exists
  [cel@dexter main]$
Signed-off-by: Chuck Lever <cel@netapp.com>
---
 stgit/stack.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Show changes to stgit/stack.py +3 −0
diff --git a/stgit/stack.py b/stgit/stack.py
index 1ffeaee..0907b37 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -775,6 +775,9 @@ class Series:
         applied = self.get_applied()
         unapplied = self.get_unapplied()
 
+        if oldname == newname:
+            raise StackException, '"To" name and "from" name are the same'
+
         if newname in applied or newname in unapplied:
             raise StackException, 'Patch "%s" already exists' % newname
 
Chuck Lever· Nov 14, 2005, 16:50 UTC · re: Chuck Lever · lore

[PATCH 2/4] use "crt_series.get_branch()" instead of "git.get_head_file()"

More cleanup to the branch command.
Signed-off-by: Chuck Lever <cel@netapp.com>
---
 stgit/commands/branch.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Show changes to stgit/commands/branch.py +3 −3
diff --git a/stgit/commands/branch.py b/stgit/commands/branch.py
index d85ba69..9bf6cdb 100644
--- a/stgit/commands/branch.py
+++ b/stgit/commands/branch.py
@@ -147,7 +147,7 @@ def func(parser, options, args):
     elif options.protect:
 
         if len(args) == 0:
-            branch_name = git.get_head_file()
+            branch_name = crt_series.get_branch()
         elif len(args) == 1:
             branch_name = args[0]
         else:
@@ -182,7 +182,7 @@ def func(parser, options, args):
     elif options.unprotect:
 
         if len(args) == 0:
-            branch_name = git.get_head_file()
+            branch_name = crt_series.get_branch()
         elif len(args) == 1:
             branch_name = args[0]
         else:
@@ -222,4 +222,4 @@ def func(parser, options, args):
     if len(args) != 0:
         parser.error('incorrect number of arguments')
 
-    print git.get_head_file()
+    print crt_series.get_branch()
Chuck Lever· Nov 14, 2005, 16:50 UTC · re: Chuck Lever · lore

[PATCH 3/4] Fix a typo in "stg pick"

"Unknown" is misspelled.
Signed-off-by: Chuck Lever <cel@netapp.com>
---
 stgit/commands/pick.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to stgit/commands/pick.py +1 −1
diff --git a/stgit/commands/pick.py b/stgit/commands/pick.py
index 3c52a49..c01c799 100644
--- a/stgit/commands/pick.py
+++ b/stgit/commands/pick.py
@@ -64,7 +64,7 @@ def func(parser, options, args):
         elif len(patch_branch) == 2:
             patch = patch_branch[0]
         else:
-            raise CmdException, 'Unkown patch name'
+            raise CmdException, 'Unknown patch name'
 
     commit_id = git_id(commit_str)
     commit = git.Commit(commit_id)
Chuck Lever· Nov 14, 2005, 16:51 UTC · re: Chuck Lever · lore
Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Chuck Lever <cel@netapp.com>
---
 stgit/commands/add.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to stgit/commands/add.py +1 −1
diff --git a/stgit/commands/add.py b/stgit/commands/add.py
index 999ce2b..fc9c5a7 100644
--- a/stgit/commands/add.py
+++ b/stgit/commands/add.py
@@ -27,7 +27,7 @@ from stgit import stack, git
 help = 'add files or directories to the repository'
 usage = """%prog [options] <files/dirs...>
 
-Add a the files or directories passed as arguments to the
+Add the files or directories passed as arguments to the
 repository. When a directory name is given, all the files and
 subdirectories are recursively added."""
 

← back to recent threads