##// END OF EJS Templates
copy: rewrite walkpat() to depend less on dirstate...
Martin von Zweigbergk -
r44839:2bd3b95f default
parent child Browse files
Show More
@@ -1419,32 +1419,35 b' def copy(ui, repo, pats, opts, rename=Fa'
1419 1419 after = opts.get(b"after")
1420 1420 dryrun = opts.get(b"dry_run")
1421 1421 wctx = repo[None]
1422 pctx = wctx.p1()
1422 1423
1423 1424 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
1424 1425
1425 1426 def walkpat(pat):
1426 1427 srcs = []
1427 if after:
1428 badstates = b'?'
1429 else:
1430 badstates = b'?r'
1431 1428 m = scmutil.match(wctx, [pat], opts, globbed=True)
1432 1429 for abs in wctx.walk(m):
1433 state = repo.dirstate[abs]
1434 1430 rel = uipathfn(abs)
1435 1431 exact = m.exact(abs)
1436 if state in badstates:
1437 if exact and state == b'?':
1438 ui.warn(_(b'%s: not copying - file is not managed\n') % rel)
1439 if exact and state == b'r':
1440 ui.warn(
1441 _(
1442 b'%s: not copying - file has been marked for'
1443 b' remove\n'
1432 if abs not in wctx:
1433 if abs in pctx:
1434 if not after:
1435 if exact:
1436 ui.warn(
1437 _(
1438 b'%s: not copying - file has been marked '
1439 b'for remove\n'
1440 )
1441 % rel
1442 )
1443 continue
1444 else:
1445 if exact:
1446 ui.warn(
1447 _(b'%s: not copying - file is not managed\n') % rel
1444 1448 )
1445 % rel
1446 )
1447 continue
1449 continue
1450
1448 1451 # abs: hgsep
1449 1452 # rel: ossep
1450 1453 srcs.append((abs, rel, exact))
General Comments 0
You need to be logged in to leave comments. Login now