Patchwork D3985: context: safegaurd against 'lx' being passed as file flag in manifest

login
register
mail settings
Submitter phabricator
Date July 31, 2018, 8:57 p.m.
Message ID <e98e63697fb6e7dd7494521f2c7e7ab6@localhost.localdomain>
Download mbox | patch
Permalink /patch/32985/
State Not Applicable
Headers show

Comments

phabricator - July 31, 2018, 8:57 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd558e53cd6b6: context: safegaurd against &#039;lx&#039; being passed as file flag in manifest (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3985?vs=9670&id=9677

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2327,7 +2327,12 @@ 
         revision being committed, or None."""
         super(memfilectx, self).__init__(repo, path, None, changectx)
         self._data = data
-        self._flags = (islink and 'l' or '') + (isexec and 'x' or '')
+        if islink:
+            self._flags = 'l'
+        elif isexec:
+            self._flags = 'x'
+        else:
+            self._flags = ''
         self._copied = None
         if copied:
             self._copied = (copied, nullid)