# HG changeset patch # User Pierre-Yves David # Date 1434749574 25200 # Node ID 3276730e4b32ac8d75191dc4d3762ffb0c13429f # Parent b3afdc0815d084c5b53b308f8d7567746836f34c 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. diff -r b3afdc0815d0 -r 3276730e4b32 hgext/evolve.py --- 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()'))