changeset 47756:7a06e04cbd68

mq: replace `add` call with newer API Differential Revision: https://phab.mercurial-scm.org/D11198
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 18 Jul 2021 22:35:37 +0200
parents 9e9c82d6f96f
children 7375add1ca92
files hgext/mq.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Mon Jul 19 08:59:00 2021 +0200
+++ b/hgext/mq.py	Sun Jul 18 22:35:37 2021 +0200
@@ -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)