Patrick Mézard avatar Patrick Mézard committed ebd286f

uncommit: add --all option

Convenient when combined with --exclude.

Comments (0)

Files changed (2)

         ds.copy(src, dst)
-    [] + 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
             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:


   $ 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.