[PATCH 2 of 2] addremove: add --subrepos flag

Angel Ezquerra angel.ezquerra at gmail.com
Sat Aug 30 10:09:09 CDT 2014


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1409411084 -7200
#      Sat Aug 30 17:04:44 2014 +0200
# Node ID 2d92ae26a1e326bb6210d429f1996989c5ce01e0
# Parent  7e317616adbe47d79fbf2243711b68f97d941f29
addremove: add --subrepos flag

This new option makes mercurial recursively run addremove on every mercurial
subrepository. Just as with commit --subrepos --adremove non mercurial
subrepositories are skipped.

diff --git a/mercurial/commands.py b/mercurial/commands.py
old mode 100644
new mode 100755
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -196,7 +196,7 @@
     return rejected and 1 or 0
 
 @command('addremove',
-    similarityopts + walkopts + dryrunopts,
+    similarityopts + walkopts + subrepoopts + dryrunopts,
     _('[OPTION]... [FILE]...'),
     inferrepo=True)
 def addremove(ui, repo, *pats, **opts):
diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -28,6 +28,15 @@
   adding x.txt
   adding foo/y.txt (glob)
 
+Test addremove with subrepos
+
+  $ echo z2 > foo/bar/z2.txt
+  $ hg addremove -S
+  adding foo/bar/z2.txt
+  $ rm foo/bar/z2.txt
+  $ hg addremove -S
+  removing foo/bar/z2.txt
+
 Test recursive status without committing anything:
 
   $ hg status -S


More information about the Mercurial-devel mailing list