diff mercurial/commands.py @ 12270:166b9866580a

add: recurse into subrepositories with --subrepos/-S flag
author Martin Geisler <mg@lazybytes.net>
date Mon, 13 Sep 2010 13:09:20 +0200
parents 877236cdd437
children 01dc8ba3e032
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 13 13:09:11 2010 +0200
+++ b/mercurial/commands.py	Mon Sep 13 13:09:20 2010 +0200
@@ -47,7 +47,8 @@
     """
 
     m = cmdutil.match(repo, pats, opts)
-    rejected = cmdutil.add(ui, repo, m, opts.get('dry_run'))
+    rejected = cmdutil.add(ui, repo, m, opts.get('dry_run'),
+                           opts.get('subrepos'), prefix="")
     return rejected and 1 or 0
 
 def addremove(ui, repo, *pats, **opts):
@@ -4001,7 +4002,8 @@
 ]
 
 table = {
-    "^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')),
+    "^add": (add, walkopts + subrepoopts + dryrunopts,
+             _('[OPTION]... [FILE]...')),
     "addremove":
         (addremove, similarityopts + walkopts + dryrunopts,
          _('[OPTION]... [FILE]...')),