Patchwork D11198: mq: replace `add` call with newer API

login
register
mail settings
Submitter phabricator
Date July 19, 2021, 3:45 p.m.
Message ID <differential-rev-PHID-DREV-gzchqhltcx7zkb7w3bgh-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49514/
State Superseded
Headers show

Comments

phabricator - July 19, 2021, 3:45 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -2010,7 +2010,9 @@ 
                             # be removed. Treat this as a simple add.
                             if src is not None and src in repo.dirstate:
                                 copies.setdefault(src, []).append(dst)
-                            repo.dirstate.add(dst)
+                            repo.dirstate.update_file(
+                                dst, p1_tracked=False, wc_tracked=True
+                            )
                         # remember the copies between patchparent and qtip
                         for dst in aaa:
                             src = ctx[dst].copysource()
@@ -2028,7 +2030,9 @@ 
                                 repo.dirstate.copy(src, dst)
                     else:
                         for dst in a:
-                            repo.dirstate.add(dst)
+                            repo.dirstate.update_file(
+                                dst, p1_tracked=False, wc_tracked=True
+                            )
                         # Drop useless copy information
                         for f in list(repo.dirstate.copies()):
                             repo.dirstate.copy(None, f)