# HG changeset patch # User Matt Mackall # Date 1153354310 18000 # Node ID 35af2e56f15a13c813a20f3f8be102158f8857f6 # Parent d0159c5f18bffb180fe399eded6d76756ea8670b manifestflags: eliminate remaining users of direct dict access diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1792,7 +1792,7 @@ class localrepository(object): # we need to reset the dirstate if the file was added get[f] = m2[f] - if not s and mfw[f] != mf2[f]: + if not s and mfw.execf(f) != mf2.execf(f): if force: self.ui.debug(_(" updating permissions for %s\n") % f) util.set_exec(self.wjoin(f), mf2.execf(f)) diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -13,6 +13,10 @@ demandload(globals(), "array bisect stru class manifestflags(dict): def __init__(self, mapping={}): dict.__init__(self, mapping) + def __getitem__(self, f): + raise "oops" + def flags(self, f): + return dict.__getitem__(self, f) def execf(self, f): "test for executable in manifest flags" return "x" in self.get(f, "") @@ -140,7 +144,7 @@ class manifest(revlog): # 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]) for f in files] + text = ["%s\000%s%s\n" % (f, hex(map[f]), flags.flags(f)) for f in files] self.listcache = array.array('c', "".join(text)) cachedelta = None else: @@ -166,7 +170,7 @@ class manifest(revlog): # 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]) + l = "%s\000%s%s\n" % (f, hex(map[f]), flags.flags(f)) else: l = "" if start == end and w[1] == 1: