threads / patch / 16435

patchDisplay (empty) when appropriate for the goto command

Subject: [PATCH] Display (empty) when appropriate for the goto command

## tl;dr

2 messages between Nov 23, 2008 and Nov 24, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Catalin Marinas· Nov 23, 2008, 21:23 UTC · lore

This is a fix for bug #11810. The original implementation of goto used to display (empty patch) when a patch became empty during a push + merge operation. This patch adds this feature again.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
 stgit/lib/transaction.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Show changes to stgit/lib/transaction.py +3 −1
diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py
index de62a8c..6623645 100644
--- a/stgit/lib/transaction.py
+++ b/stgit/lib/transaction.py
@@ -290,7 +290,6 @@ class StackTransaction(object):
         conflicts to them."""
         orig_cd = self.patches[pn].data
         cd = orig_cd.set_committer(None)
-        s = ['', ' (empty)'][cd.is_nochange()]
         oldparent = cd.parent
         cd = cd.set_parent(self.top)
         base = oldparent.data.tree
@@ -298,6 +297,7 @@ class StackTransaction(object):
         theirs = cd.tree
         tree, self.temp_index_tree = self.temp_index.merge(
             base, ours, theirs, self.temp_index_tree)
+        s = ''
         merge_conflict = False
         if not tree:
             if iw == None:
@@ -324,6 +324,8 @@ class StackTransaction(object):
         else:
             comm = None
             s = ' (unmodified)'
+        if not merge_conflict and cd.is_nochange():
+            s = ' (empty)'
         out.info('Pushed %s%s' % (pn, s))
         def update():
             if comm:
Karl Hasselström· Nov 24, 2008, 11:19 UTC · re: Catalin Marinas · lore

Re: [PATCH] Display (empty) when appropriate for the goto command

On 2008-11-23 21:23:18 +0000, Catalin Marinas wrote:
Show 5 quoted lines
> This is a fix for bug #11810. The original implementation of goto
> used to display (empty patch) when a patch became empty during a
> push + merge operation. This patch adds this feature again.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

← back to recent threads