equal
deleted
inserted
replaced
318 |
318 |
319 |
319 |
320 def setupwrapcolorwrite(ui): |
320 def setupwrapcolorwrite(ui): |
321 # wrap ui.write so diff output can be labeled/colorized |
321 # wrap ui.write so diff output can be labeled/colorized |
322 def wrapwrite(orig, *args, **kw): |
322 def wrapwrite(orig, *args, **kw): |
323 label = kw.pop(r'label', b'') |
323 label = kw.pop('label', b'') |
324 for chunk, l in patch.difflabel(lambda: args): |
324 for chunk, l in patch.difflabel(lambda: args): |
325 orig(chunk, label=label + l) |
325 orig(chunk, label=label + l) |
326 |
326 |
327 oldwrite = ui.write |
327 oldwrite = ui.write |
328 |
328 |
2395 sub = wctx.sub(subpath) |
2395 sub = wctx.sub(subpath) |
2396 try: |
2396 try: |
2397 submatch = matchmod.subdirmatcher(subpath, match) |
2397 submatch = matchmod.subdirmatcher(subpath, match) |
2398 subprefix = repo.wvfs.reljoin(prefix, subpath) |
2398 subprefix = repo.wvfs.reljoin(prefix, subpath) |
2399 subuipathfn = scmutil.subdiruipathfn(subpath, uipathfn) |
2399 subuipathfn = scmutil.subdiruipathfn(subpath, uipathfn) |
2400 if opts.get(r'subrepos'): |
2400 if opts.get('subrepos'): |
2401 bad.extend( |
2401 bad.extend( |
2402 sub.add(ui, submatch, subprefix, subuipathfn, False, **opts) |
2402 sub.add(ui, submatch, subprefix, subuipathfn, False, **opts) |
2403 ) |
2403 ) |
2404 else: |
2404 else: |
2405 bad.extend( |
2405 bad.extend( |
2408 except error.LookupError: |
2408 except error.LookupError: |
2409 ui.status( |
2409 ui.status( |
2410 _(b"skipping missing subrepository: %s\n") % uipathfn(subpath) |
2410 _(b"skipping missing subrepository: %s\n") % uipathfn(subpath) |
2411 ) |
2411 ) |
2412 |
2412 |
2413 if not opts.get(r'dry_run'): |
2413 if not opts.get('dry_run'): |
2414 rejected = wctx.add(names, prefix) |
2414 rejected = wctx.add(names, prefix) |
2415 bad.extend(f for f in rejected if f in match.files()) |
2415 bad.extend(f for f in rejected if f in match.files()) |
2416 return bad |
2416 return bad |
2417 |
2417 |
2418 |
2418 |