##// END OF EJS Templates
py3: handle opts correctly for `hg add`...
Pulkit Goyal -
r32147:a77e61b4 default
parent child Browse files
Show More
@@ -2279,7 +2279,7 b' def add(ui, repo, match, prefix, explici'
2279 sub = wctx.sub(subpath)
2279 sub = wctx.sub(subpath)
2280 try:
2280 try:
2281 submatch = matchmod.subdirmatcher(subpath, match)
2281 submatch = matchmod.subdirmatcher(subpath, match)
2282 if opts.get('subrepos'):
2282 if opts.get(r'subrepos'):
2283 bad.extend(sub.add(ui, submatch, prefix, False, **opts))
2283 bad.extend(sub.add(ui, submatch, prefix, False, **opts))
2284 else:
2284 else:
2285 bad.extend(sub.add(ui, submatch, prefix, True, **opts))
2285 bad.extend(sub.add(ui, submatch, prefix, True, **opts))
@@ -2287,7 +2287,7 b' def add(ui, repo, match, prefix, explici'
2287 ui.status(_("skipping missing subrepository: %s\n")
2287 ui.status(_("skipping missing subrepository: %s\n")
2288 % join(subpath))
2288 % join(subpath))
2289
2289
2290 if not opts.get('dry_run'):
2290 if not opts.get(r'dry_run'):
2291 rejected = wctx.add(names, prefix)
2291 rejected = wctx.add(names, prefix)
2292 bad.extend(f for f in rejected if f in match.files())
2292 bad.extend(f for f in rejected if f in match.files())
2293 return bad
2293 return bad
@@ -255,8 +255,7 b' def add(ui, repo, *pats, **opts):'
255 Returns 0 if all files are successfully added.
255 Returns 0 if all files are successfully added.
256 """
256 """
257
257
258 opts = pycompat.byteskwargs(opts)
258 m = scmutil.match(repo[None], pats, pycompat.byteskwargs(opts))
259 m = scmutil.match(repo[None], pats, opts)
260 rejected = cmdutil.add(ui, repo, m, "", False, **opts)
259 rejected = cmdutil.add(ui, repo, m, "", False, **opts)
261 return rejected and 1 or 0
260 return rejected and 1 or 0
262
261
@@ -1771,7 +1771,7 b' class gitsubrepo(abstractsubrepo):'
1771 if exact:
1771 if exact:
1772 rejected.append(f)
1772 rejected.append(f)
1773 continue
1773 continue
1774 if not opts.get('dry_run'):
1774 if not opts.get(r'dry_run'):
1775 self._gitcommand(command + [f])
1775 self._gitcommand(command + [f])
1776
1776
1777 for f in rejected:
1777 for f in rejected:
General Comments 0
You need to be logged in to leave comments. Login now