context: safegaurd from 'lx' being passed as file flag in manifest
authorPulkit Goyal <pulkit@yandex-team.ru>
Wed, 01 Aug 2018 16:28:10 +0300
changeset 39066 2488dcfa71f8
parent 39065 730e7d92a023
child 39067 daedb70fd467
context: safegaurd from 'lx' being passed as file flag in manifest Follows up for d558e53cd6b619d5f671a7580513bfc66a398eac. Differential Revision: https://phab.mercurial-scm.org/D4259
mercurial/context.py
--- 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)