[StGit PATCH 07/13] Clean up Series.refresh_patch

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David
Date: Friday, September 14, 2007 - 3:31 pm

This patch does some minor simplifications of the code and updates the
documentation string of Series.refresh_patch.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---

 stgit/stack.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)


diff --git a/stgit/stack.py b/stgit/stack.py
index 9b8ed6e..03ce218 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -749,14 +749,12 @@ class Series(PatchSet):
                       committer_name = None, committer_email = None,
                       backup = False, sign_str = None, log = 'refresh',
                       notes = None):
-        """Generates a new commit for the given patch
+        """Generates a new commit for the topmost patch
         """
-        name = self.get_current()
-        if not name:
+        patch = self.get_current_patch()
+        if not patch:
             raise StackException, 'No patches applied'
 
-        patch = self.get_patch(name)
-
         descr = patch.get_description()
         if not (message or descr):
             edit = True
@@ -767,7 +765,7 @@ class Series(PatchSet):
         if not message and edit:
             descr = edit_file(self, descr.rstrip(), \
                               'Please edit the description for patch "%s" ' \
-                              'above.' % name, show_patch)
+                              'above.' % patch.get_name(), show_patch)
 
         if not author_name:
             author_name = patch.get_authname()

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[StGit PATCH 06/13] Refactor Series.push_patch, David , (Fri Sep 14, 3:31 pm)
[StGit PATCH 07/13] Clean up Series.refresh_patch, David , (Fri Sep 14, 3:31 pm)
[StGit PATCH 10/13] Refactor Series.new_patch, David , (Fri Sep 14, 3:32 pm)
[StGit PATCH 12/13] Remove the 'bottom' field, David , (Fri Sep 14, 3:32 pm)
[StGit PATCH 13/13] Remove the 'top' field, David , (Fri Sep 14, 3:32 pm)
Re: [StGit PATCH 00/13] Eliminate 'top' and 'bottom' files, Catalin Marinas, (Sun Sep 16, 12:28 am)
Re: [StGit PATCH 13/13] Remove the 'top' field, David Kågedal, (Sun Sep 16, 3:22 am)
Re: [StGit PATCH 00/13] Eliminate 'top' and 'bottom' files, David Kågedal, (Sun Sep 16, 3:25 am)
Re: [StGit PATCH 00/13] Eliminate 'top' and 'bottom' files, David Kågedal, (Sun Sep 16, 3:28 am)
Re: [StGit PATCH 13/13] Remove the 'top' field, Karl , (Mon Sep 17, 12:30 am)