Patchwork D8032: copy: rename `wctx` to `ctx` since it will not necessarily be working copy

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2020, 5:57 a.m.
Message ID <5c9ccedfe754b35258020f0e90fce9cd@localhost.localdomain>
Download mbox | patch
Permalink /patch/45166/
State Not Applicable
Headers show

Comments

phabricator - Feb. 11, 2020, 5:57 a.m.
martinvonz updated this revision to Diff 20151.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8032?vs=20084&id=20151

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8032/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8032

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1421,8 +1421,8 @@ 
     forget = opts.get(b"forget")
     after = opts.get(b"after")
     dryrun = opts.get(b"dry_run")
-    wctx = repo[None]
-    pctx = wctx.p1()
+    ctx = repo[None]
+    pctx = ctx.p1()
 
     uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
 
@@ -1482,11 +1482,11 @@ 
 
     def walkpat(pat):
         srcs = []
-        m = scmutil.match(wctx, [pat], opts, globbed=True)
-        for abs in wctx.walk(m):
+        m = scmutil.match(ctx, [pat], opts, globbed=True)
+        for abs in ctx.walk(m):
             rel = uipathfn(abs)
             exact = m.exact(abs)
-            if abs not in wctx:
+            if abs not in ctx:
                 if abs in pctx:
                     if not after:
                         if exact:
@@ -1639,13 +1639,13 @@ 
 
         # fix up dirstate
         scmutil.dirstatecopy(
-            ui, repo, wctx, abssrc, abstarget, dryrun=dryrun, cwd=cwd
+            ui, repo, ctx, abssrc, abstarget, dryrun=dryrun, cwd=cwd
         )
         if rename and not dryrun:
             if not after and srcexists and not samefile:
                 rmdir = repo.ui.configbool(b'experimental', b'removeemptydirs')
                 repo.wvfs.unlinkpath(abssrc, rmdir=rmdir)
-            wctx.forget([abssrc])
+            ctx.forget([abssrc])
 
     # pat: ossep
     # dest ossep