evolve: move the 'update' if '.' is obsolete earlier
A big refactoring of the computation of the revision to evolve is coming. This
case won't be handled by it, so we extract it earlier.
--- a/hgext/evolve.py Tue Jun 16 17:56:23 2015 -0700
+++ b/hgext/evolve.py Fri Jun 19 14:32:54 2015 -0700
@@ -1412,6 +1412,18 @@
raise util.Abort(msg)
elif len(specifiedcategories) == 1:
targetcat = specifiedcategories[0]
+ elif repo['.'].obsolete():
+ displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
+ # no args and parent is obsolete, update to successors
+ try:
+ ctx = repo[_singlesuccessor(repo, repo['.'])]
+ except MultipleSuccessorsError, exc:
+ repo.ui.write_err('parent is obsolete with multiple successors:\n')
+ for ln in exc.successorssets:
+ for n in ln:
+ displayer.show(repo[n])
+ return 2
+
ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve')
troubled = set(repo.revs('troubled()'))