Patchwork D11014: context: use `dirstate.set_tracked` in context.add

login
register
mail settings
Submitter phabricator
Date July 8, 2021, 7:34 a.m.
Message ID <differential-rev-PHID-DREV-a4wwxofoiwzld646zlex-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49328/
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/D11014

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
@@ -1701,12 +1701,8 @@ 
                         % uipath(f)
                     )
                     rejected.append(f)
-                elif ds[f] in b'amn':
+                elif not ds.set_tracked(f):
                     ui.warn(_(b"%s already tracked!\n") % uipath(f))
-                elif ds[f] == b'r':
-                    ds.normallookup(f)
-                else:
-                    ds.add(f)
             return rejected
 
     def forget(self, files, prefix=b""):