evolve: extract cleanup logic in the evolve function
We are going to need to reuse the cleanup logic when introducing --rev, so
we extract it in a method to avoid code duplication.
--- a/hgext/evolve.py Thu Apr 30 14:25:37 2015 -0700
+++ b/hgext/evolve.py Tue May 05 14:25:35 2015 -0700
@@ -1215,6 +1215,14 @@
else:
ui.write_err(_('no troubled changesets\n'))
return 1
+
+def _cleanup(ui, repo, startnode, showprogress):
+ if showprogress:
+ ui.progress('evolve', None)
+ if repo['.'] != startnode:
+ ui.status(_('working directory is now at %s\n') % repo['.'])
+
+
@command('^evolve|stabilize|solve',
[('n', 'dry-run', False,
'do not perform actions, just print what would be done'),
@@ -1296,12 +1304,7 @@
# Resolving a single trouble
_solveone(ui, repo, nexttrouble, dryrunopt, confirmopt, progresscb)
- # Cleanup
- if showprogress:
- ui.progress('evolve', None)
-
- if repo['.'] != startnode:
- ui.status(_('working directory is now at %s\n') % repo['.'])
+ _cleanup(ui, repo, startnode, showprogress)
def _evolveany(ui, repo, tro, dryrunopt, confirmopt, progresscb):