[Commented On] D11199: dirstate: deprecate the `add` method

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Tue Jul 20 08:13:38 UTC 2021


baymax added a comment.
baymax updated this revision to Diff 29579.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11199?vs=29498&id=29579

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -819,9 +819,16 @@
 
     def add(self, f):
         '''Mark a file added.'''
-        if not self.pendingparentchange():
+        if self.pendingparentchange():
             util.nouideprecwarn(
-                b"do not use `add` outside of update/merge context."
+                b"do not use `add` inside of update/merge context."
+                b" Use `update_file`",
+                b'6.0',
+                stacklevel=2,
+            )
+        else:
+            util.nouideprecwarn(
+                b"do not use `remove` outside of update/merge context."
                 b" Use `set_tracked`",
                 b'6.0',
                 stacklevel=2,



To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210720/32ade7b1/attachment-0002.html>


More information about the Mercurial-patches mailing list