Fix some bugs introduced during the manifest refactoring
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Sat, 12 Aug 2006 08:53:23 -0300
changeset 2857 18cf5349a361
parent 2856 a3c73c9679d2
child 2858 c9b08cacf983
Fix some bugs introduced during the manifest refactoring
mercurial/archival.py
mercurial/hgweb/hgweb_mod.py
mercurial/localrepo.py
mercurial/manifest.py
--- a/mercurial/archival.py	Sat Aug 12 09:24:04 2006 -0300
+++ b/mercurial/archival.py	Sat Aug 12 08:53:23 2006 -0300
@@ -163,11 +163,12 @@
     change = repo.changelog.read(node)
     mn = change[0]
     archiver = archivers[kind](dest, prefix, mtime or change[2][0])
-    mf = repo.manifest.read(mn).items()
-    mf.sort()
+    m = repo.manifest.read(mn)
+    items = m.items()
+    items.sort()
     write('.hg_archival.txt', 0644,
           'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
-    for filename, filenode in mf:
-        write(filename, mf.execf(filename) and 0755 or 0644,
+    for filename, filenode in items:
+        write(filename, m.execf(filename) and 0755 or 0644,
               repo.file(filename).read(filenode))
     archiver.done()
--- a/mercurial/hgweb/hgweb_mod.py	Sat Aug 12 09:24:04 2006 -0300
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Aug 12 08:53:23 2006 -0300
@@ -398,7 +398,7 @@
                      parent=self.siblings(fl.parents(n), fl.rev, file=f),
                      child=self.siblings(fl.children(n), fl.rev, file=f),
                      rename=self.renamelink(fl, n),
-                     permissions=self.repo.manifest.read(mfn).execf[f])
+                     permissions=self.repo.manifest.read(mfn).execf(f))
 
     def fileannotate(self, f, node):
         bcache = {}
@@ -452,7 +452,7 @@
                      rename=self.renamelink(fl, n),
                      parent=self.siblings(fl.parents(n), fl.rev, file=f),
                      child=self.siblings(fl.children(n), fl.rev, file=f),
-                     permissions=self.repo.manifest.read(mfn).execf[f])
+                     permissions=self.repo.manifest.read(mfn).execf(f))
 
     def manifest(self, mnode, path):
         man = self.repo.manifest
@@ -495,7 +495,7 @@
                        "filenode": hex(fnode),
                        "parity": self.stripes(parity),
                        "basename": f,
-                       "permissions": mf.execf[full]}
+                       "permissions": mf.execf(full)}
                 parity += 1
 
         def dirlist(**map):
--- a/mercurial/localrepo.py	Sat Aug 12 09:24:04 2006 -0300
+++ b/mercurial/localrepo.py	Sat Aug 12 08:53:23 2006 -0300
@@ -502,7 +502,6 @@
             except IOError:
                 try:
                     del m1[f]
-                    del m1[f]
                     if update_dirstate:
                         self.dirstate.forget([f])
                 except:
--- a/mercurial/manifest.py	Sat Aug 12 09:24:04 2006 -0300
+++ b/mercurial/manifest.py	Sat Aug 12 08:53:23 2006 -0300
@@ -11,7 +11,9 @@
 demandload(globals(), "array bisect struct")
 
 class manifestdict(dict):
-    def __init__(self, mapping={}, flags={}):
+    def __init__(self, mapping=None, flags=None):
+        if mapping is None: mapping = {}
+        if flags is None: flags = {}
         dict.__init__(self, mapping)
         self._flags = flags
     def flags(self, f):
@@ -27,8 +29,9 @@
         fl = entry[40:-1]
         if fl: self._flags[f] = fl
     def set(self, f, execf=False, linkf=False):
-        if execf: self._flags[f] = "x"
-        if linkf: self._flags[f] = "x"
+        if linkf: self._flags[f] = "l"
+        elif execf: self._flags[f] = "x"
+        else: self._flags[f] = ""
     def copy(self):
         return manifestdict(dict.copy(self), dict.copy(self._flags))