##// END OF EJS Templates
add: pass options via keyword args...
Matt Harbison -
r23885:9994f45b default
parent child Browse files
Show More
@@ -1979,7 +1979,7 b' def graphrevs(repo, nodes, opts):'
1979 1979 nodes = nodes[:limit]
1980 1980 return graphmod.nodes(repo, nodes)
1981 1981
1982 def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly):
1982 def add(ui, repo, match, prefix, explicitonly, **opts):
1983 1983 join = lambda f: os.path.join(prefix, f)
1984 1984 bad = []
1985 1985 oldbad = match.bad
@@ -2003,17 +2003,15 b' def add(ui, repo, match, dryrun, listsub'
2003 2003 sub = wctx.sub(subpath)
2004 2004 try:
2005 2005 submatch = matchmod.narrowmatcher(subpath, match)
2006 if listsubrepos:
2007 bad.extend(sub.add(ui, submatch, dryrun, listsubrepos, prefix,
2008 False))
2006 if opts.get('subrepos'):
2007 bad.extend(sub.add(ui, submatch, prefix, False, **opts))
2009 2008 else:
2010 bad.extend(sub.add(ui, submatch, dryrun, listsubrepos, prefix,
2011 True))
2009 bad.extend(sub.add(ui, submatch, prefix, True, **opts))
2012 2010 except error.LookupError:
2013 2011 ui.status(_("skipping missing subrepository: %s\n")
2014 2012 % join(subpath))
2015 2013
2016 if not dryrun:
2014 if not opts.get('dry_run'):
2017 2015 rejected = wctx.add(names, prefix)
2018 2016 bad.extend(f for f in rejected if f in match.files())
2019 2017 return bad
@@ -199,8 +199,7 b' def add(ui, repo, *pats, **opts):'
199 199 """
200 200
201 201 m = scmutil.match(repo[None], pats, opts)
202 rejected = cmdutil.add(ui, repo, m, opts.get('dry_run'),
203 opts.get('subrepos'), prefix="", explicitonly=False)
202 rejected = cmdutil.add(ui, repo, m, "", False, **opts)
204 203 return rejected and 1 or 0
205 204
206 205 @command('addremove',
@@ -621,9 +621,10 b' class hgsubrepo(abstractsubrepo):'
621 621 fp.close()
622 622
623 623 @annotatesubrepoerror
624 def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly):
625 return cmdutil.add(ui, self._repo, match, dryrun, listsubrepos,
626 os.path.join(prefix, self._path), explicitonly)
624 def add(self, ui, match, prefix, explicitonly, **opts):
625 return cmdutil.add(ui, self._repo, match,
626 os.path.join(prefix, self._path), explicitonly,
627 **opts)
627 628
628 629 def addremove(self, m, prefix, opts, dry_run, similarity):
629 630 # In the same way as sub directories are processed, once in a subrepo,
General Comments 0
You need to be logged in to leave comments. Login now