uncommit: add --all option
Convenient when combined with --exclude.
--- a/hgext/evolve.py Tue Jun 26 16:12:52 2012 +0200
+++ b/hgext/evolve.py Sat Jun 23 19:24:37 2012 +0200
@@ -564,7 +564,8 @@
ds.copy(src, dst)
@command('^uncommit',
- [] + commands.walkopts,
+ [('a', 'all', None, _('uncommit all changes when no arguments given')),
+ ] + commands.walkopts,
_('[OPTION]... [NAME]'))
def uncommit(ui, repo, *pats, **opts):
"""move changes from parent revision to working directory
@@ -597,7 +598,8 @@
updatebookmarks = _bookmarksupdater(repo, old.node())
# Recommit the filtered changeset
newid = None
- if pats or opts.get('include') or opts.get('exclude'):
+ if (pats or opts.get('include') or opts.get('exclude')
+ or opts.get('all')):
match = scmutil.match(old, pats, opts)
newid = _commitfiltered(repo, old, match)
if newid is None:
--- a/tests/test-uncommit.t Tue Jun 26 16:12:52 2012 +0200
+++ b/tests/test-uncommit.t Sat Jun 23 19:24:37 2012 +0200
@@ -277,3 +277,31 @@
$ hg debugsuccessors
5eb72dbe0cb4 c706fe2c12f8
5eb72dbe0cb4 e8db4aa611f6
+
+Test --all
+
+ $ hg up -C 3
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ Working directory parent is obsolete
+ $ hg --config extensions.purge= purge
+ $ hg uncommit --all -X e
+ $ hg st --copies
+ M b
+ M d
+ M j
+ M o
+ A aa
+ a
+ A ff
+ f
+ A h
+ g
+ A k
+ A l
+ R c
+ R f
+ R g
+ R m
+ R n
+ $ hg st --copies --change .
+ A e