Patchwork D11015: context: use `dirstate.set_tracked` in context.copy

login
register
mail settings
Submitter phabricator
Date July 8, 2021, 7:34 a.m.
Message ID <differential-rev-PHID-DREV-pqx6yxbmassmxlori5hm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49329/
State Superseded
Headers show

Comments

phabricator - July 8, 2021, 7:34 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is the new shinny API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1738,10 +1738,7 @@ 
         else:
             with self._repo.wlock():
                 ds = self._repo.dirstate
-                if ds[dest] in b'?':
-                    ds.add(dest)
-                elif ds[dest] in b'r':
-                    ds.normallookup(dest)
+                ds.set_tracked(dest)
                 ds.copy(source, dest)
 
     def match(