context: use `dirstate.set_tracked` in context.copy
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 08 Jul 2021 00:57:25 +0200
changeset 47595 14e2f4bd5f16
parent 47594 0cef28b121a4
child 47596 791e2333d3d3
context: use `dirstate.set_tracked` in context.copy This is the new shiny API. Differential Revision: https://phab.mercurial-scm.org/D11015
mercurial/context.py
--- a/mercurial/context.py	Thu Jul 08 00:58:44 2021 +0200
+++ b/mercurial/context.py	Thu Jul 08 00:57:25 2021 +0200
@@ -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(