aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@gmail.com>2010-03-09 10:05:58 +0000
committerCatalin Marinas <catalin.marinas@gmail.com>2010-03-09 10:05:58 +0000
commit7d7210c881f52397e421238528d4368c6a51414b (patch)
tree4b987063ed1e53b2bcddc86d57b65060c111c693
parent1b0c0113861681974b8905dbe10a57f6831ecb87 (diff)
downloadstgit-7d7210c881f52397e421238528d4368c6a51414b.tar.gz
Allow interactive merging via StackTransaction.reorder_patches()
This way other commands like sink and pop can use the interactive mergetool. Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
-rw-r--r--stgit/commands/pop.py3
-rw-r--r--stgit/commands/sink.py3
-rw-r--r--stgit/lib/transaction.py5
3 files changed, 7 insertions, 4 deletions
diff --git a/stgit/commands/pop.py b/stgit/commands/pop.py
index f67cc0a..abf2814 100644
--- a/stgit/commands/pop.py
+++ b/stgit/commands/pop.py
@@ -79,7 +79,8 @@ def func(parser, options, args):
applied = [p for p in trans.applied if not p in set(patches)]
unapplied = patches + trans.unapplied
try:
- trans.reorder_patches(applied, unapplied, iw = iw)
+ trans.reorder_patches(applied, unapplied, iw = iw,
+ allow_interactive = True)
except transaction.TransactionException:
pass
return trans.run(iw)
diff --git a/stgit/commands/sink.py b/stgit/commands/sink.py
index eadc27d..4b7535e 100644
--- a/stgit/commands/sink.py
+++ b/stgit/commands/sink.py
@@ -89,7 +89,8 @@ def func(parser, options, args):
check_clean_iw = clean_iw)
try:
- trans.reorder_patches(applied, unapplied, iw = iw)
+ trans.reorder_patches(applied, unapplied, iw = iw,
+ allow_interactive = True)
except transaction.TransactionHalted:
pass
return trans.run(iw)
diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py
index d82e724..e76f5ab 100644
--- a/stgit/lib/transaction.py
+++ b/stgit/lib/transaction.py
@@ -398,7 +398,8 @@ class StackTransaction(object):
del x[x.index(pn)]
self.applied.append(pn)
- def reorder_patches(self, applied, unapplied, hidden = None, iw = None):
+ def reorder_patches(self, applied, unapplied, hidden = None, iw = None,
+ allow_interactive = False):
"""Push and pop patches to attain the given ordering."""
if hidden is None:
hidden = self.hidden
@@ -407,7 +408,7 @@ class StackTransaction(object):
to_pop = set(self.applied[common:])
self.pop_patches(lambda pn: pn in to_pop)
for pn in applied[common:]:
- self.push_patch(pn, iw)
+ self.push_patch(pn, iw, allow_interactive = allow_interactive)
assert self.applied == applied
assert set(self.unapplied + self.hidden) == set(unapplied + hidden)
self.unapplied = unapplied