##// 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 b' def archive(repo, dest, node, kind, deco'
163 change = repo.changelog.read(node)
163 change = repo.changelog.read(node)
164 mn = change[0]
164 mn = change[0]
165 archiver = archivers[kind](dest, prefix, mtime or change[2][0])
165 archiver = archivers[kind](dest, prefix, mtime or change[2][0])
166 mf = repo.manifest.read(mn).items()
166 m = repo.manifest.read(mn)
167 mf.sort()
167 items = m.items()
168 items.sort()
168 write('.hg_archival.txt', 0644,
169 write('.hg_archival.txt', 0644,
169 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
170 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
170 for filename, filenode in mf:
171 for filename, filenode in items:
171 write(filename, mf.execf(filename) and 0755 or 0644,
172 write(filename, m.execf(filename) and 0755 or 0644,
172 repo.file(filename).read(filenode))
173 repo.file(filename).read(filenode))
173 archiver.done()
174 archiver.done()
@@ -398,7 +398,7 b' class hgweb(object):'
398 parent=self.siblings(fl.parents(n), fl.rev, file=f),
398 parent=self.siblings(fl.parents(n), fl.rev, file=f),
399 child=self.siblings(fl.children(n), fl.rev, file=f),
399 child=self.siblings(fl.children(n), fl.rev, file=f),
400 rename=self.renamelink(fl, n),
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 def fileannotate(self, f, node):
403 def fileannotate(self, f, node):
404 bcache = {}
404 bcache = {}
@@ -452,7 +452,7 b' class hgweb(object):'
452 rename=self.renamelink(fl, n),
452 rename=self.renamelink(fl, n),
453 parent=self.siblings(fl.parents(n), fl.rev, file=f),
453 parent=self.siblings(fl.parents(n), fl.rev, file=f),
454 child=self.siblings(fl.children(n), fl.rev, file=f),
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 def manifest(self, mnode, path):
457 def manifest(self, mnode, path):
458 man = self.repo.manifest
458 man = self.repo.manifest
@@ -495,7 +495,7 b' class hgweb(object):'
495 "filenode": hex(fnode),
495 "filenode": hex(fnode),
496 "parity": self.stripes(parity),
496 "parity": self.stripes(parity),
497 "basename": f,
497 "basename": f,
498 "permissions": mf.execf[full]}
498 "permissions": mf.execf(full)}
499 parity += 1
499 parity += 1
500
500
501 def dirlist(**map):
501 def dirlist(**map):
@@ -502,7 +502,6 b' class localrepository(repo.repository):'
502 except IOError:
502 except IOError:
503 try:
503 try:
504 del m1[f]
504 del m1[f]
505 del m1[f]
506 if update_dirstate:
505 if update_dirstate:
507 self.dirstate.forget([f])
506 self.dirstate.forget([f])
508 except:
507 except:
@@ -11,7 +11,9 b' from demandload import *'
11 demandload(globals(), "array bisect struct")
11 demandload(globals(), "array bisect struct")
12
12
13 class manifestdict(dict):
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 dict.__init__(self, mapping)
17 dict.__init__(self, mapping)
16 self._flags = flags
18 self._flags = flags
17 def flags(self, f):
19 def flags(self, f):
@@ -27,8 +29,9 b' class manifestdict(dict):'
27 fl = entry[40:-1]
29 fl = entry[40:-1]
28 if fl: self._flags[f] = fl
30 if fl: self._flags[f] = fl
29 def set(self, f, execf=False, linkf=False):
31 def set(self, f, execf=False, linkf=False):
30 if execf: self._flags[f] = "x"
32 if linkf: self._flags[f] = "l"
31 if linkf: self._flags[f] = "x"
33 elif execf: self._flags[f] = "x"
34 else: self._flags[f] = ""
32 def copy(self):
35 def copy(self):
33 return manifestdict(dict.copy(self), dict.copy(self._flags))
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