changeset 39066:2488dcfa71f8

context: safegaurd from 'lx' being passed as file flag in manifest Follows up for d558e53cd6b619d5f671a7580513bfc66a398eac. Differential Revision: https://phab.mercurial-scm.org/D4259
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 01 Aug 2018 16:28:10 +0300
parents 730e7d92a023
children daedb70fd467
files mercurial/context.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Fri Aug 10 03:33:38 2018 -0400
+++ b/mercurial/context.py	Wed Aug 01 16:28:10 2018 +0300
@@ -1926,8 +1926,13 @@
                         flags=flags)
 
     def setflags(self, path, l, x):
+        flag = ''
+        if l:
+            flag = 'l'
+        elif x:
+            flag = 'x'
         self._markdirty(path, exists=True, date=dateutil.makedate(),
-                        flags=(l and 'l' or '') + (x and 'x' or ''))
+                        flags=flag)
 
     def remove(self, path):
         self._markdirty(path, exists=False)