##// END OF EJS Templates
copy: rename `wctx` to `ctx` since it will not necessarily be working copy...
Martin von Zweigbergk -
r44840:27a78ea3 default
parent child Browse files
Show More
@@ -1418,18 +1418,18 b' def copy(ui, repo, pats, opts, rename=Fa'
1418 1418 targets = {}
1419 1419 after = opts.get(b"after")
1420 1420 dryrun = opts.get(b"dry_run")
1421 wctx = repo[None]
1422 pctx = wctx.p1()
1421 ctx = repo[None]
1422 pctx = ctx.p1()
1423 1423
1424 1424 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
1425 1425
1426 1426 def walkpat(pat):
1427 1427 srcs = []
1428 m = scmutil.match(wctx, [pat], opts, globbed=True)
1429 for abs in wctx.walk(m):
1428 m = scmutil.match(ctx, [pat], opts, globbed=True)
1429 for abs in ctx.walk(m):
1430 1430 rel = uipathfn(abs)
1431 1431 exact = m.exact(abs)
1432 if abs not in wctx:
1432 if abs not in ctx:
1433 1433 if abs in pctx:
1434 1434 if not after:
1435 1435 if exact:
@@ -1582,13 +1582,13 b' def copy(ui, repo, pats, opts, rename=Fa'
1582 1582
1583 1583 # fix up dirstate
1584 1584 scmutil.dirstatecopy(
1585 ui, repo, wctx, abssrc, abstarget, dryrun=dryrun, cwd=cwd
1585 ui, repo, ctx, abssrc, abstarget, dryrun=dryrun, cwd=cwd
1586 1586 )
1587 1587 if rename and not dryrun:
1588 1588 if not after and srcexists and not samefile:
1589 1589 rmdir = repo.ui.configbool(b'experimental', b'removeemptydirs')
1590 1590 repo.wvfs.unlinkpath(abssrc, rmdir=rmdir)
1591 wctx.forget([abssrc])
1591 ctx.forget([abssrc])
1592 1592
1593 1593 # pat: ossep
1594 1594 # dest ossep
General Comments 0
You need to be logged in to leave comments. Login now