Mercurial > hg-stable
changeset 2833:d0159c5f18bf
Use strings for manifestflags to allow storing multiple flags
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 16 Jul 2006 03:22:05 -0500 |
parents | e196aa1df169 |
children | 35af2e56f15a |
files | mercurial/manifest.py |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/manifest.py Sun Jul 16 03:14:17 2006 -0500 +++ b/mercurial/manifest.py Sun Jul 16 03:22:05 2006 -0500 @@ -15,12 +15,15 @@ dict.__init__(self, mapping) def execf(self, f): "test for executable in manifest flags" - return self.get(f, False) + return "x" in self.get(f, "") def linkf(self, f): "test for symlink in manifest flags" - return False + return "l" in self.get(f, "") def set(self, f, execf=False, linkf=False): - self[f] = execf + fl = "" + if execf: fl = "x" + if linkf: fl = "l" + self[f] = fl def copy(self): return manifestflags(dict.copy(self)) @@ -43,7 +46,7 @@ for l in lines: (f, n) = l.split('\0') map[f] = bin(n[:40]) - flag[f] = (n[40:-1] == "x") + flag[f] = n[40:-1] self.mapcache = (node, map, flag) return map @@ -137,9 +140,7 @@ # if this is changed to support newlines in filenames, # be sure to check the templates/ dir again (especially *-raw.tmpl) - text = ["%s\000%s%s\n" % - (f, hex(map[f]), flags[f] and "x" or '') - for f in files] + text = ["%s\000%s%s\n" % (f, hex(map[f]), flags[f]) for f in files] self.listcache = array.array('c', "".join(text)) cachedelta = None else: @@ -165,8 +166,7 @@ # bs will either be the index of the item or the insert point start, end = self._search(addbuf, f, start) if w[1] == 0: - l = "%s\000%s%s\n" % (f, hex(map[f]), - flags[f] and "x" or '') + l = "%s\000%s%s\n" % (f, hex(map[f]), flags[f]) else: l = "" if start == end and w[1] == 1: