comparison 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
comparison
equal deleted inserted replaced
12269:877236cdd437 12270:166b9866580a
45 45
46 Returns 0 if all files are successfully added. 46 Returns 0 if all files are successfully added.
47 """ 47 """
48 48
49 m = cmdutil.match(repo, pats, opts) 49 m = cmdutil.match(repo, pats, opts)
50 rejected = cmdutil.add(ui, repo, m, opts.get('dry_run')) 50 rejected = cmdutil.add(ui, repo, m, opts.get('dry_run'),
51 opts.get('subrepos'), prefix="")
51 return rejected and 1 or 0 52 return rejected and 1 or 0
52 53
53 def addremove(ui, repo, *pats, **opts): 54 def addremove(ui, repo, *pats, **opts):
54 """add all new files, delete all missing files 55 """add all new files, delete all missing files
55 56
3999 ('S', 'subrepos', None, 4000 ('S', 'subrepos', None,
4000 _('recurse into subrepositories')) 4001 _('recurse into subrepositories'))
4001 ] 4002 ]
4002 4003
4003 table = { 4004 table = {
4004 "^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')), 4005 "^add": (add, walkopts + subrepoopts + dryrunopts,
4006 _('[OPTION]... [FILE]...')),
4005 "addremove": 4007 "addremove":
4006 (addremove, similarityopts + walkopts + dryrunopts, 4008 (addremove, similarityopts + walkopts + dryrunopts,
4007 _('[OPTION]... [FILE]...')), 4009 _('[OPTION]... [FILE]...')),
4008 "^annotate|blame": 4010 "^annotate|blame":
4009 (annotate, 4011 (annotate,