[Updated] D8534: flags: read flag from dirstate/disk for workingcopyctx (issue5743)

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Thu May 28 16:40:32 UTC 2020


Closed by commit rHG4234c9af515d: flags: read flag from dirstate/disk for workingcopyctx (issue5743) (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/D8534?vs=21398&id=21502

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

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

AFFECTED FILES
  mercurial/context.py
  tests/test-merge-exec.t

CHANGE DETAILS

diff --git a/tests/test-merge-exec.t b/tests/test-merge-exec.t
--- a/tests/test-merge-exec.t
+++ b/tests/test-merge-exec.t
@@ -209,6 +209,5 @@
     a
   R a
   $ [ -x z ] || echo "executable bit lost"
-  executable bit lost
 
   $ cd ..
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1458,6 +1458,18 @@
     def children(self):
         return []
 
+    def flags(self, path):
+        if '_manifest' in self.__dict__:
+            try:
+                return self._manifest.flags(path)
+            except KeyError:
+                return b''
+
+        try:
+            return self._flagfunc(path)
+        except OSError:
+            return b''
+
     def ancestor(self, c2):
         """return the "best" ancestor context of self and c2"""
         return self._parents[0].ancestor(c2)  # punt on two parents for now
@@ -1594,12 +1606,6 @@
         return self._repo.dirstate.flagfunc(self._buildflagfunc)
 
     def flags(self, path):
-        if '_manifest' in self.__dict__:
-            try:
-                return self._manifest.flags(path)
-            except KeyError:
-                return b''
-
         try:
             return self._flagfunc(path)
         except OSError:



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


More information about the Mercurial-patches mailing list