--- a/hgext3rd/evolve/__init__.py Sat Nov 10 16:05:34 2018 +0100
+++ b/hgext3rd/evolve/__init__.py Sat Nov 10 15:50:05 2018 +0100
@@ -1105,7 +1105,7 @@
[('B', 'move-bookmark', False,
_('move active bookmark after update')),
('m', 'merge', False, _('bring uncommitted change along')),
- ('', 'evolve', False, _('evolve the next changeset if necessary')),
+ ('', 'evolve', True, _('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,11 +1128,6 @@
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()
@@ -1144,13 +1139,21 @@
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
- if not opts['merge']:
+ # 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:
# we only skip the check if noconflict is set
if ui.config('commands', 'update.check') == 'noconflict':
pass
@@ -1173,16 +1176,12 @@
else:
return _updatetonext(ui, repo, repo[choosedrev], displayer, opts)
else:
- if not opts['evolve'] or not aspchildren:
+ if 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"