##// END OF EJS Templates
Change remaining users of manifest flags
Matt Mackall -
r2840:046a8b03 default
parent child Browse files
Show More
@@ -886,7 +886,6 b' class queue:'
886 top = self.check_toppatch(repo)
886 top = self.check_toppatch(repo)
887 qp = self.qparents(repo, rev)
887 qp = self.qparents(repo, rev)
888 changes = repo.changelog.read(qp)
888 changes = repo.changelog.read(qp)
889 mf1 = repo.manifest.readflags(changes[0])
890 mmap = repo.manifest.read(changes[0])
889 mmap = repo.manifest.read(changes[0])
891 (c, a, r, d, u) = repo.changes(qp, top)
890 (c, a, r, d, u) = repo.changes(qp, top)
892 if d:
891 if d:
@@ -895,7 +894,7 b' class queue:'
895 getfile(f, mmap[f])
894 getfile(f, mmap[f])
896 for f in r:
895 for f in r:
897 getfile(f, mmap[f])
896 getfile(f, mmap[f])
898 util.set_exec(repo.wjoin(f), mf1[f])
897 util.set_exec(repo.wjoin(f), mmap.execf[f])
899 repo.dirstate.update(c + r, 'n')
898 repo.dirstate.update(c + r, 'n')
900 for f in a:
899 for f in a:
901 try: os.unlink(repo.wjoin(f))
900 try: os.unlink(repo.wjoin(f))
@@ -164,11 +164,10 b' def archive(repo, dest, node, kind, deco'
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 mf = repo.manifest.read(mn).items()
167 mff = repo.manifest.readflags(mn)
168 mf.sort()
167 mf.sort()
169 write('.hg_archival.txt', 0644,
168 write('.hg_archival.txt', 0644,
170 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
169 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
171 for filename, filenode in mf:
170 for filename, filenode in mf:
172 write(filename, mff.execf(filename) and 0755 or 0644,
171 write(filename, mf.execf(filename) and 0755 or 0644,
173 repo.file(filename).read(filenode))
172 repo.file(filename).read(filenode))
174 archiver.done()
173 archiver.done()
@@ -1333,9 +1333,9 b' def debugrebuildstate(ui, repo, rev=None'
1333 rev = repo.lookup(rev)
1333 rev = repo.lookup(rev)
1334 change = repo.changelog.read(rev)
1334 change = repo.changelog.read(rev)
1335 n = change[0]
1335 n = change[0]
1336 files = repo.manifest.readflags(n)
1336 files = repo.manifest.read(n)
1337 wlock = repo.wlock()
1337 wlock = repo.wlock()
1338 repo.dirstate.rebuild(rev, files.iteritems())
1338 repo.dirstate.rebuild(rev, files)
1339
1339
1340 def debugcheckstate(ui, repo):
1340 def debugcheckstate(ui, repo):
1341 """validate the correctness of the current dirstate"""
1341 """validate the correctness of the current dirstate"""
@@ -2146,13 +2146,12 b' def manifest(ui, repo, rev=None):'
2146 else:
2146 else:
2147 n = repo.manifest.tip()
2147 n = repo.manifest.tip()
2148 m = repo.manifest.read(n)
2148 m = repo.manifest.read(n)
2149 mf = repo.manifest.readflags(n)
2150 files = m.keys()
2149 files = m.keys()
2151 files.sort()
2150 files.sort()
2152
2151
2153 for f in files:
2152 for f in files:
2154 ui.write("%40s %3s %s\n" % (hex(m[f]),
2153 ui.write("%40s %3s %s\n" % (hex(m[f]),
2155 mf.execf(f) and "755" or "644", f))
2154 m.execf(f) and "755" or "644", f))
2156
2155
2157 def merge(ui, repo, node=None, force=None, branch=None):
2156 def merge(ui, repo, node=None, force=None, branch=None):
2158 """Merge working directory with another revision
2157 """Merge working directory with another revision
@@ -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.readflags(mfn)[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.readflags(mfn)[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
@@ -462,7 +462,6 b' class hgweb(object):'
462 rev = man.rev(mn)
462 rev = man.rev(mn)
463 changerev = man.linkrev(mn)
463 changerev = man.linkrev(mn)
464 node = self.repo.changelog.node(changerev)
464 node = self.repo.changelog.node(changerev)
465 mff = man.readflags(mn)
466
465
467 files = {}
466 files = {}
468
467
@@ -496,7 +495,7 b' class hgweb(object):'
496 "filenode": hex(fnode),
495 "filenode": hex(fnode),
497 "parity": self.stripes(parity),
496 "parity": self.stripes(parity),
498 "basename": f,
497 "basename": f,
499 "permissions": mff[full]}
498 "permissions": mf.execf[full]}
500 parity += 1
499 parity += 1
501
500
502 def dirlist(**map):
501 def dirlist(**map):
@@ -470,8 +470,7 b' class localrepository(repo.repository):'
470 p2 = p2 or self.dirstate.parents()[1] or nullid
470 p2 = p2 or self.dirstate.parents()[1] or nullid
471 c1 = self.changelog.read(p1)
471 c1 = self.changelog.read(p1)
472 c2 = self.changelog.read(p2)
472 c2 = self.changelog.read(p2)
473 m1 = self.manifest.read(c1[0])
473 m1 = self.manifest.read(c1[0]).copy()
474 mf1 = self.manifest.readflags(c1[0])
475 m2 = self.manifest.read(c2[0])
474 m2 = self.manifest.read(c2[0])
476 changed = []
475 changed = []
477
476
@@ -484,35 +483,33 b' class localrepository(repo.repository):'
484 wlock = self.wlock()
483 wlock = self.wlock()
485 l = self.lock()
484 l = self.lock()
486 tr = self.transaction()
485 tr = self.transaction()
487 mm = m1.copy()
488 mfm = mf1.copy()
489 linkrev = self.changelog.count()
486 linkrev = self.changelog.count()
490 for f in files:
487 for f in files:
491 try:
488 try:
492 t = self.wread(f)
489 t = self.wread(f)
493 mfm.set(f, util.is_exec(self.wjoin(f), mfm.execf(f)))
490 m1.set(f, util.is_exec(self.wjoin(f), m1.execf(f)))
494 r = self.file(f)
491 r = self.file(f)
495
492
496 (entry, fp1, fp2) = self.checkfilemerge(f, t, r, m1, m2)
493 (entry, fp1, fp2) = self.checkfilemerge(f, t, r, m1, m2)
497 if entry:
494 if entry:
498 mm[f] = entry
495 m1[f] = entry
499 continue
496 continue
500
497
501 mm[f] = r.add(t, {}, tr, linkrev, fp1, fp2)
498 m1[f] = r.add(t, {}, tr, linkrev, fp1, fp2)
502 changed.append(f)
499 changed.append(f)
503 if update_dirstate:
500 if update_dirstate:
504 self.dirstate.update([f], "n")
501 self.dirstate.update([f], "n")
505 except IOError:
502 except IOError:
506 try:
503 try:
507 del mm[f]
504 del m1[f]
508 del mfm[f]
505 del m1[f]
509 if update_dirstate:
506 if update_dirstate:
510 self.dirstate.forget([f])
507 self.dirstate.forget([f])
511 except:
508 except:
512 # deleted from p2?
509 # deleted from p2?
513 pass
510 pass
514
511
515 mnode = self.manifest.add(mm, mfm, tr, linkrev, c1[0], c2[0])
512 mnode = self.manifest.add(m1, m1, tr, linkrev, c1[0], c2[0])
516 user = user or self.ui.username()
513 user = user or self.ui.username()
517 n = self.changelog.add(mnode, changed, text, tr, p1, p2, user, date)
514 n = self.changelog.add(mnode, changed, text, tr, p1, p2, user, date)
518 tr.close()
515 tr.close()
@@ -543,8 +540,7 b' class localrepository(repo.repository):'
543 p1, p2 = self.dirstate.parents()
540 p1, p2 = self.dirstate.parents()
544 c1 = self.changelog.read(p1)
541 c1 = self.changelog.read(p1)
545 c2 = self.changelog.read(p2)
542 c2 = self.changelog.read(p2)
546 m1 = self.manifest.read(c1[0])
543 m1 = self.manifest.read(c1[0]).copy()
547 mf1 = self.manifest.readflags(c1[0])
548 m2 = self.manifest.read(c2[0])
544 m2 = self.manifest.read(c2[0])
549
545
550 if not commit and not remove and not force and p2 == nullid:
546 if not commit and not remove and not force and p2 == nullid:
@@ -570,7 +566,7 b' class localrepository(repo.repository):'
570 for f in commit:
566 for f in commit:
571 self.ui.note(f + "\n")
567 self.ui.note(f + "\n")
572 try:
568 try:
573 mf1.set(f, util.is_exec(self.wjoin(f), mf1.execf(f)))
569 m1.set(f, util.is_exec(self.wjoin(f), m1.execf(f)))
574 t = self.wread(f)
570 t = self.wread(f)
575 except IOError:
571 except IOError:
576 self.ui.warn(_("trouble committing %s!\n") % f)
572 self.ui.warn(_("trouble committing %s!\n") % f)
@@ -597,12 +593,11 b' class localrepository(repo.repository):'
597 changed.append(f)
593 changed.append(f)
598
594
599 # update manifest
595 # update manifest
600 m1 = m1.copy()
601 m1.update(new)
596 m1.update(new)
602 for f in remove:
597 for f in remove:
603 if f in m1:
598 if f in m1:
604 del m1[f]
599 del m1[f]
605 mn = self.manifest.add(m1, mf1, tr, linkrev, c1[0], c2[0],
600 mn = self.manifest.add(m1, m1, tr, linkrev, c1[0], c2[0],
606 (new, remove))
601 (new, remove))
607
602
608 # add changeset
603 # add changeset
@@ -815,7 +810,6 b' class localrepository(repo.repository):'
815 def undelete(self, list, wlock=None):
810 def undelete(self, list, wlock=None):
816 p = self.dirstate.parents()[0]
811 p = self.dirstate.parents()[0]
817 mn = self.changelog.read(p)[0]
812 mn = self.changelog.read(p)[0]
818 mf = self.manifest.readflags(mn)
819 m = self.manifest.read(mn)
813 m = self.manifest.read(mn)
820 if not wlock:
814 if not wlock:
821 wlock = self.wlock()
815 wlock = self.wlock()
@@ -825,7 +819,7 b' class localrepository(repo.repository):'
825 else:
819 else:
826 t = self.file(f).read(m[f])
820 t = self.file(f).read(m[f])
827 self.wwrite(f, t)
821 self.wwrite(f, t)
828 util.set_exec(self.wjoin(f), mf.execf(f))
822 util.set_exec(self.wjoin(f), m.execf(f))
829 self.dirstate.update([f], "n")
823 self.dirstate.update([f], "n")
830
824
831 def copy(self, source, dest, wlock=None):
825 def copy(self, source, dest, wlock=None):
General Comments 0
You need to be logged in to leave comments. Login now