oops: backed out changeset df22f010cf24 pushed by error
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 10 Nov 2018 16:11:19 +0100
changeset 4242 a07df2aa1b7d
parent 4241 df22f010cf24
child 4243 e49af4917a6b
oops: backed out changeset df22f010cf24 pushed by error The changeset still fails some test
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Sat Nov 10 15:50:05 2018 +0100
+++ b/hgext3rd/evolve/__init__.py	Sat Nov 10 16:11:19 2018 +0100
@@ -1105,7 +1105,7 @@
     [('B', 'move-bookmark', False,
         _('move active bookmark after update')),
      ('m', 'merge', False, _('bring uncommitted change along')),
-     ('', 'evolve', True, _('evolve the next changeset if necessary')),
+     ('', 'evolve', False, _('evolve the next changeset if necessary')),
      ('', 'no-topic', False, _('ignore topic and move topologically')),
      ('n', 'dry-run', False,
       _('do not perform actions, just print what would be done'))],
@@ -1128,6 +1128,11 @@
         if len(wparents) != 1:
             raise error.Abort(_('merge in progress'))
 
+        # check for dirty wdir if --evolve is passed
+        if opts['evolve']:
+            hint = _('use `hg amend`, `hg revert` or `hg shelve`')
+            cmdutil.bailifchanged(repo, hint=hint)
+
         children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()]
         topic = _getcurrenttopic(repo)
         filtered = set()
@@ -1139,21 +1144,13 @@
         displayer = compat.changesetdisplayer(ui, repo, {'template': template})
 
         # check if we need to evolve while updating to the next child revision
-        needevolve = False
         aspchildren = evolvecmd._aspiringchildren(repo, [repo['.'].rev()])
         if topic:
             filtered.update(repo[c] for c in aspchildren
                             if repo[c].topic() != topic)
             aspchildren = [ctx for ctx in aspchildren if ctx not in filtered]
-        if aspchildren:
-            needevolve = True
 
-        # check if working directory is clean before we evolve the next cset
-        if needevolve:
-            hint = _('use `hg amend`, `hg revert` or `hg shelve`')
-            cmdutil.bailifchanged(repo, hint=hint)
-
-        if not opts['merge'] and not needevolve:
+        if not opts['merge']:
             # we only skip the check if noconflict is set
             if ui.config('commands', 'update.check') == 'noconflict':
                 pass
@@ -1176,12 +1173,16 @@
             else:
                 return _updatetonext(ui, repo, repo[choosedrev], displayer, opts)
         else:
-            if not aspchildren:
+            if not opts['evolve'] or not aspchildren:
                 if filtered:
                     ui.warn(_('no children on topic "%s"\n') % topic)
                     ui.warn(_('do you want --no-topic\n'))
                 else:
                     ui.warn(_('no children\n'))
+                if aspchildren:
+                    msg = _('(%i unstable changesets to be evolved here, '
+                            'do you want --evolve?)\n')
+                    ui.warn(msg % len(aspchildren))
                 return 1
             elif 1 < len(aspchildren):
                 cheader = _("ambiguous next (unstable) changeset, choose one to"