diff mercurial/pure/parsers.py @ 47512:769037a279ec

dirstate-entry: add a `state` property (and use it) This replace the [0] access. Ultimately is we should probably get ride of this in its current form. However this is a good transitional solution to move away for tuple indexing for now. Differential Revision: https://phab.mercurial-scm.org/D10954
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Jul 2021 03:29:20 +0200
parents 80dc1d452993
children 10e740292dff
line wrap: on
line diff
--- a/mercurial/pure/parsers.py	Sat Jul 03 19:52:00 2021 +0200
+++ b/mercurial/pure/parsers.py	Sun Jul 04 03:29:20 2021 +0200
@@ -64,6 +64,21 @@
         else:
             raise IndexError(idx)
 
+    @property
+    def state(self):
+        """
+        States are:
+          n  normal
+          m  needs merging
+          r  marked for removal
+          a  marked for addition
+
+        XXX This "state" is a bit obscure and mostly a direct expression of the
+        dirstatev1 format. It would make sense to ultimately deprecate it in
+        favor of the more "semantic" attributes.
+        """
+        return self._state
+
     def v1_state(self):
         """return a "state" suitable for v1 serialization"""
         return self._state