Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 32196:a77e61b45384
py3: handle opts correctly for `hg add`
opts in add command were passed again to cmdutil.add() as kwargs so we need
to convert them again to str. Intstead we convert them to bytes when passing
scmutil.match(). Opts handling is also corrected for all the functions which
are called from cmdutil.add().
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 25 Apr 2017 01:52:30 +0530 |
parents | 93155367a2a6 |
children | 6f173560c7f4 |
comparison
equal
deleted
inserted
replaced
32195:e807c373846a | 32196:a77e61b45384 |
---|---|
2277 | 2277 |
2278 for subpath in sorted(wctx.substate): | 2278 for subpath in sorted(wctx.substate): |
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)) |
2286 except error.LookupError: | 2286 except error.LookupError: |
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 |
2294 | 2294 |
2295 def addwebdirpath(repo, serverpath, webconf): | 2295 def addwebdirpath(repo, serverpath, webconf): |