##// END OF EJS Templates
Fix some bugs introduced during the manifest refactoring
Alexis S. L. Carvalho -
r2857:18cf5349 default
parent child Browse files
Show More
@@ -163,11 +163,12 def archive(repo, dest, node, kind, deco
163 163 change = repo.changelog.read(node)
164 164 mn = change[0]
165 165 archiver = archivers[kind](dest, prefix, mtime or change[2][0])
166 mf = repo.manifest.read(mn).items()
167 mf.sort()
166 m = repo.manifest.read(mn)
167 items = m.items()
168 items.sort()
168 169 write('.hg_archival.txt', 0644,
169 170 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
170 for filename, filenode in mf:
171 write(filename, mf.execf(filename) and 0755 or 0644,
171 for filename, filenode in items:
172 write(filename, m.execf(filename) and 0755 or 0644,
172 173 repo.file(filename).read(filenode))
173 174 archiver.done()
@@ -398,7 +398,7 class hgweb(object):
398 398 parent=self.siblings(fl.parents(n), fl.rev, file=f),
399 399 child=self.siblings(fl.children(n), fl.rev, file=f),
400 400 rename=self.renamelink(fl, n),
401 permissions=self.repo.manifest.read(mfn).execf[f])
401 permissions=self.repo.manifest.read(mfn).execf(f))
402 402
403 403 def fileannotate(self, f, node):
404 404 bcache = {}
@@ -452,7 +452,7 class hgweb(object):
452 452 rename=self.renamelink(fl, n),
453 453 parent=self.siblings(fl.parents(n), fl.rev, file=f),
454 454 child=self.siblings(fl.children(n), fl.rev, file=f),
455 permissions=self.repo.manifest.read(mfn).execf[f])
455 permissions=self.repo.manifest.read(mfn).execf(f))
456 456
457 457 def manifest(self, mnode, path):
458 458 man = self.repo.manifest
@@ -495,7 +495,7 class hgweb(object):
495 495 "filenode": hex(fnode),
496 496 "parity": self.stripes(parity),
497 497 "basename": f,
498 "permissions": mf.execf[full]}
498 "permissions": mf.execf(full)}
499 499 parity += 1
500 500
501 501 def dirlist(**map):
@@ -502,7 +502,6 class localrepository(repo.repository):
502 502 except IOError:
503 503 try:
504 504 del m1[f]
505 del m1[f]
506 505 if update_dirstate:
507 506 self.dirstate.forget([f])
508 507 except:
@@ -11,7 +11,9 from demandload import *
11 11 demandload(globals(), "array bisect struct")
12 12
13 13 class manifestdict(dict):
14 def __init__(self, mapping={}, flags={}):
14 def __init__(self, mapping=None, flags=None):
15 if mapping is None: mapping = {}
16 if flags is None: flags = {}
15 17 dict.__init__(self, mapping)
16 18 self._flags = flags
17 19 def flags(self, f):
@@ -27,8 +29,9 class manifestdict(dict):
27 29 fl = entry[40:-1]
28 30 if fl: self._flags[f] = fl
29 31 def set(self, f, execf=False, linkf=False):
30 if execf: self._flags[f] = "x"
31 if linkf: self._flags[f] = "x"
32 if linkf: self._flags[f] = "l"
33 elif execf: self._flags[f] = "x"
34 else: self._flags[f] = ""
32 35 def copy(self):
33 36 return manifestdict(dict.copy(self), dict.copy(self._flags))
34 37
General Comments 0
You need to be logged in to leave comments. Login now