dirstate-item: implement `added` in a simpler way
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 27 Aug 2021 17:07:56 +0200
changeset 47929 03f57915e0ce
parent 47928 f1033c2d9b66
child 47930 7c37d153c22d
dirstate-item: implement `added` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11366
mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py	Fri Aug 27 17:07:12 2021 +0200
+++ b/mercurial/pure/parsers.py	Fri Aug 27 17:07:56 2021 +0200
@@ -268,7 +268,7 @@
     @property
     def added(self):
         """True if the file has been added"""
-        return self.v1_state() == b'a'
+        return self._wc_tracked and not (self._p1_tracked or self._p2_tracked)
 
     @property
     def merged(self):