[Updated] D11014: context: use `dirstate.set_tracked` in `context.add`
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Thu Jul 15 16:54:57 UTC 2021
Closed by commit rHG0cef28b121a4: context: use `dirstate.set_tracked` in `context.add` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11014?vs=29250&id=29272
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11014/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11014
AFFECTED FILES
mercurial/context.py
mercurial/dirstate.py
CHANGE DETAILS
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -85,7 +85,7 @@
def requires_no_parents_change(func):
def wrap(self, *args, **kwargs):
- if not self.pendingparentchange():
+ if self.pendingparentchange():
msg = 'calling `%s` inside of a parentchange context'
msg %= func.__name__
raise error.ProgrammingError(msg)
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""):
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/20210715/ae816164/attachment-0002.html>
More information about the Mercurial-patches
mailing list