diff hgext/evolve.py @ 465:4a039a8c1cf3

stabilize: --continue support !!! Based on graft one.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 20 Aug 2012 14:13:29 +0200
parents d88c761f97c4
children b98490b689a5
line wrap: on
line diff
--- a/hgext/evolve.py	Mon Aug 20 12:31:43 2012 +0200
+++ b/hgext/evolve.py	Mon Aug 20 14:13:29 2012 +0200
@@ -226,7 +226,8 @@
 
 @command('^stabilize|evolve|solve',
     [('n', 'dry-run', False, 'do not perform actions, print what to be done'),
-    ('A', 'any', False, 'stabilize any unstable changeset'),],
+    ('A', 'any', False, 'stabilize any unstable changeset'),
+    ('c', 'continue', False, 'continue an interrupted stabilized'), ],
     _('[OPTIONS]...'))
 def stabilize(ui, repo, **opts):
     """rebase an unstable changeset to make it stable again
@@ -240,6 +241,15 @@
     The working directory is updated to the rebased revision.
     """
 
+    contopt = opts['continue']
+    anyopt = opts['any']
+
+    if contopt:
+        if anyopt:
+            raise util.Abort('can not specify both "--any" and "--continue"')
+        graftcmd = commands.table['graft'][0]
+        return graftcmd(ui, repo, old_obsolete=True, **{'continue': True})
+
     obsolete = extensions.find('obsolete')
 
     orig = None
@@ -290,9 +300,9 @@
         try:
             relocate(repo, orig, target)
         except MergeFailure:
-            repo.ui.write_err(_('/!\\ stabilize failed                          /!\\\n'))
-            repo.ui.write_err(_('/!\\ Their is no "hg stabilize --continue"     /!\\\n'))
-            repo.ui.write_err(_('/!\\ use "hg up -C . ; hg stabilize --dry-run" /!\\\n'))
+            repo.opener.write('graftstate', orig.hex() + '\n')
+            repo.ui.write_err(_('stabilize failed!\n'))
+            repo.ui.write_err(_('fix conflict and run "hg stabilize --continue"\n'))
             raise
         finally:
             lock.release()