changeset 2840:046a8b03ea59

Change remaining users of manifest flags
author Matt Mackall <mpm@selenic.com>
date Fri, 11 Aug 2006 10:57:42 -0500
parents b4f05ecf4ee8
children e3fb4223e750
files hgext/mq.py mercurial/archival.py mercurial/commands.py mercurial/hgweb/hgweb_mod.py mercurial/localrepo.py
diffstat 5 files changed, 19 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Thu Aug 10 22:38:56 2006 -0500
+++ b/hgext/mq.py	Fri Aug 11 10:57:42 2006 -0500
@@ -886,7 +886,6 @@
             top = self.check_toppatch(repo)
             qp = self.qparents(repo, rev)
             changes = repo.changelog.read(qp)
-            mf1 = repo.manifest.readflags(changes[0])
             mmap = repo.manifest.read(changes[0])
             (c, a, r, d, u) = repo.changes(qp, top)
             if d:
@@ -895,7 +894,7 @@
                 getfile(f, mmap[f])
             for f in r:
                 getfile(f, mmap[f])
-                util.set_exec(repo.wjoin(f), mf1[f])
+                util.set_exec(repo.wjoin(f), mmap.execf[f])
             repo.dirstate.update(c + r, 'n')
             for f in a:
                 try: os.unlink(repo.wjoin(f))
--- a/mercurial/archival.py	Thu Aug 10 22:38:56 2006 -0500
+++ b/mercurial/archival.py	Fri Aug 11 10:57:42 2006 -0500
@@ -164,11 +164,10 @@
     mn = change[0]
     archiver = archivers[kind](dest, prefix, mtime or change[2][0])
     mf = repo.manifest.read(mn).items()
-    mff = repo.manifest.readflags(mn)
     mf.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, mff.execf(filename) and 0755 or 0644,
+        write(filename, mf.execf(filename) and 0755 or 0644,
               repo.file(filename).read(filenode))
     archiver.done()
--- a/mercurial/commands.py	Thu Aug 10 22:38:56 2006 -0500
+++ b/mercurial/commands.py	Fri Aug 11 10:57:42 2006 -0500
@@ -1333,9 +1333,9 @@
         rev = repo.lookup(rev)
     change = repo.changelog.read(rev)
     n = change[0]
-    files = repo.manifest.readflags(n)
+    files = repo.manifest.read(n)
     wlock = repo.wlock()
-    repo.dirstate.rebuild(rev, files.iteritems())
+    repo.dirstate.rebuild(rev, files)
 
 def debugcheckstate(ui, repo):
     """validate the correctness of the current dirstate"""
@@ -2146,13 +2146,12 @@
     else:
         n = repo.manifest.tip()
     m = repo.manifest.read(n)
-    mf = repo.manifest.readflags(n)
     files = m.keys()
     files.sort()
 
     for f in files:
         ui.write("%40s %3s %s\n" % (hex(m[f]),
-                                    mf.execf(f) and "755" or "644", f))
+                                    m.execf(f) and "755" or "644", f))
 
 def merge(ui, repo, node=None, force=None, branch=None):
     """Merge working directory with another revision
--- a/mercurial/hgweb/hgweb_mod.py	Thu Aug 10 22:38:56 2006 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Aug 11 10:57:42 2006 -0500
@@ -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.readflags(mfn)[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.readflags(mfn)[f])
+                     permissions=self.repo.manifest.read(mfn).execf[f])
 
     def manifest(self, mnode, path):
         man = self.repo.manifest
@@ -462,7 +462,6 @@
         rev = man.rev(mn)
         changerev = man.linkrev(mn)
         node = self.repo.changelog.node(changerev)
-        mff = man.readflags(mn)
 
         files = {}
 
@@ -496,7 +495,7 @@
                        "filenode": hex(fnode),
                        "parity": self.stripes(parity),
                        "basename": f,
-                       "permissions": mff[full]}
+                       "permissions": mf.execf[full]}
                 parity += 1
 
         def dirlist(**map):
--- a/mercurial/localrepo.py	Thu Aug 10 22:38:56 2006 -0500
+++ b/mercurial/localrepo.py	Fri Aug 11 10:57:42 2006 -0500
@@ -470,8 +470,7 @@
         p2 = p2 or self.dirstate.parents()[1] or nullid
         c1 = self.changelog.read(p1)
         c2 = self.changelog.read(p2)
-        m1 = self.manifest.read(c1[0])
-        mf1 = self.manifest.readflags(c1[0])
+        m1 = self.manifest.read(c1[0]).copy()
         m2 = self.manifest.read(c2[0])
         changed = []
 
@@ -484,35 +483,33 @@
             wlock = self.wlock()
         l = self.lock()
         tr = self.transaction()
-        mm = m1.copy()
-        mfm = mf1.copy()
         linkrev = self.changelog.count()
         for f in files:
             try:
                 t = self.wread(f)
-                mfm.set(f, util.is_exec(self.wjoin(f), mfm.execf(f)))
+                m1.set(f, util.is_exec(self.wjoin(f), m1.execf(f)))
                 r = self.file(f)
 
                 (entry, fp1, fp2) = self.checkfilemerge(f, t, r, m1, m2)
                 if entry:
-                    mm[f] = entry
+                    m1[f] = entry
                     continue
 
-                mm[f] = r.add(t, {}, tr, linkrev, fp1, fp2)
+                m1[f] = r.add(t, {}, tr, linkrev, fp1, fp2)
                 changed.append(f)
                 if update_dirstate:
                     self.dirstate.update([f], "n")
             except IOError:
                 try:
-                    del mm[f]
-                    del mfm[f]
+                    del m1[f]
+                    del m1[f]
                     if update_dirstate:
                         self.dirstate.forget([f])
                 except:
                     # deleted from p2?
                     pass
 
-        mnode = self.manifest.add(mm, mfm, tr, linkrev, c1[0], c2[0])
+        mnode = self.manifest.add(m1, m1, tr, linkrev, c1[0], c2[0])
         user = user or self.ui.username()
         n = self.changelog.add(mnode, changed, text, tr, p1, p2, user, date)
         tr.close()
@@ -543,8 +540,7 @@
         p1, p2 = self.dirstate.parents()
         c1 = self.changelog.read(p1)
         c2 = self.changelog.read(p2)
-        m1 = self.manifest.read(c1[0])
-        mf1 = self.manifest.readflags(c1[0])
+        m1 = self.manifest.read(c1[0]).copy()
         m2 = self.manifest.read(c2[0])
 
         if not commit and not remove and not force and p2 == nullid:
@@ -570,7 +566,7 @@
         for f in commit:
             self.ui.note(f + "\n")
             try:
-                mf1.set(f, util.is_exec(self.wjoin(f), mf1.execf(f)))
+                m1.set(f, util.is_exec(self.wjoin(f), m1.execf(f)))
                 t = self.wread(f)
             except IOError:
                 self.ui.warn(_("trouble committing %s!\n") % f)
@@ -597,12 +593,11 @@
             changed.append(f)
 
         # update manifest
-        m1 = m1.copy()
         m1.update(new)
         for f in remove:
             if f in m1:
                 del m1[f]
-        mn = self.manifest.add(m1, mf1, tr, linkrev, c1[0], c2[0],
+        mn = self.manifest.add(m1, m1, tr, linkrev, c1[0], c2[0],
                                (new, remove))
 
         # add changeset
@@ -815,7 +810,6 @@
     def undelete(self, list, wlock=None):
         p = self.dirstate.parents()[0]
         mn = self.changelog.read(p)[0]
-        mf = self.manifest.readflags(mn)
         m = self.manifest.read(mn)
         if not wlock:
             wlock = self.wlock()
@@ -825,7 +819,7 @@
             else:
                 t = self.file(f).read(m[f])
                 self.wwrite(f, t)
-                util.set_exec(self.wjoin(f), mf.execf(f))
+                util.set_exec(self.wjoin(f), m.execf(f))
                 self.dirstate.update([f], "n")
 
     def copy(self, source, dest, wlock=None):