Show More
@@ -461,7 +461,7 b' class localrepository(object):' | |||||
461 | return manifest.manifest(self.svfs) |
|
461 | return manifest.manifest(self.svfs) | |
462 |
|
462 | |||
463 | def dirlog(self, dir): |
|
463 | def dirlog(self, dir): | |
464 |
return manifest. |
|
464 | return self.manifest.dirlog(dir) | |
465 |
|
465 | |||
466 | @repofilecache('dirstate') |
|
466 | @repofilecache('dirstate') | |
467 | def dirstate(self): |
|
467 | def dirstate(self): |
@@ -796,7 +796,11 b' class treemanifest(object):' | |||||
796 | writesubtree(subm, subp1, subp2) |
|
796 | writesubtree(subm, subp1, subp2) | |
797 |
|
797 | |||
798 | class manifest(revlog.revlog): |
|
798 | class manifest(revlog.revlog): | |
799 | def __init__(self, opener, dir=''): |
|
799 | def __init__(self, opener, dir='', dirlogcache=None): | |
|
800 | '''The 'dir' and 'dirlogcache' arguments are for internal use by | |||
|
801 | manifest.manifest only. External users should create a root manifest | |||
|
802 | log with manifest.manifest(opener) and call dirlog() on it. | |||
|
803 | ''' | |||
800 | # During normal operations, we expect to deal with not more than four |
|
804 | # During normal operations, we expect to deal with not more than four | |
801 | # revs at a time (such as during commit --amend). When rebasing large |
|
805 | # revs at a time (such as during commit --amend). When rebasing large | |
802 | # stacks of commits, the number can go up, hence the config knob below. |
|
806 | # stacks of commits, the number can go up, hence the config knob below. | |
@@ -820,12 +824,24 b' class manifest(revlog.revlog):' | |||||
820 | indexfile = "meta/" + dir + "00manifest.i" |
|
824 | indexfile = "meta/" + dir + "00manifest.i" | |
821 | revlog.revlog.__init__(self, opener, indexfile) |
|
825 | revlog.revlog.__init__(self, opener, indexfile) | |
822 | self._dir = dir |
|
826 | self._dir = dir | |
|
827 | # The dirlogcache is kept on the root manifest log | |||
|
828 | if dir: | |||
|
829 | self._dirlogcache = dirlogcache | |||
|
830 | else: | |||
|
831 | self._dirlogcache = {'': self} | |||
823 |
|
832 | |||
824 | def _newmanifest(self, data=''): |
|
833 | def _newmanifest(self, data=''): | |
825 | if self._treeinmem: |
|
834 | if self._treeinmem: | |
826 | return treemanifest(self._dir, data) |
|
835 | return treemanifest(self._dir, data) | |
827 | return manifestdict(data) |
|
836 | return manifestdict(data) | |
828 |
|
837 | |||
|
838 | def dirlog(self, dir): | |||
|
839 | assert self._treeondisk | |||
|
840 | if dir not in self._dirlogcache: | |||
|
841 | self._dirlogcache[dir] = manifest(self.opener, dir, | |||
|
842 | self._dirlogcache) | |||
|
843 | return self._dirlogcache[dir] | |||
|
844 | ||||
829 | def _slowreaddelta(self, node): |
|
845 | def _slowreaddelta(self, node): | |
830 | r0 = self.deltaparent(self.rev(node)) |
|
846 | r0 = self.deltaparent(self.rev(node)) | |
831 | m0 = self.read(self.node(r0)) |
|
847 | m0 = self.read(self.node(r0)) | |
@@ -867,8 +883,7 b' class manifest(revlog.revlog):' | |||||
867 | text = self.revision(node) |
|
883 | text = self.revision(node) | |
868 | if self._treeondisk: |
|
884 | if self._treeondisk: | |
869 | def readsubtree(dir, subm): |
|
885 | def readsubtree(dir, subm): | |
870 | sublog = manifest(self.opener, dir) |
|
886 | return self.dirlog(dir).read(subm) | |
871 | return sublog.read(subm) |
|
|||
872 | m = self._newmanifest() |
|
887 | m = self._newmanifest() | |
873 | m.parse(text, readsubtree) |
|
888 | m.parse(text, readsubtree) | |
874 | m.setnode(node) |
|
889 | m.setnode(node) | |
@@ -929,7 +944,7 b' class manifest(revlog.revlog):' | |||||
929 |
|
944 | |||
930 | def _addtree(self, m, transaction, link, m1, m2): |
|
945 | def _addtree(self, m, transaction, link, m1, m2): | |
931 | def writesubtree(subm, subp1, subp2): |
|
946 | def writesubtree(subm, subp1, subp2): | |
932 |
sublog = |
|
947 | sublog = self.dirlog(subm.dir()) | |
933 | sublog.add(subm, transaction, link, subp1, subp2, None, None) |
|
948 | sublog.add(subm, transaction, link, subp1, subp2, None, None) | |
934 | m.writesubtrees(m1, m2, writesubtree) |
|
949 | m.writesubtrees(m1, m2, writesubtree) | |
935 | text = m.dirtext(self._usemanifestv2) |
|
950 | text = m.dirtext(self._usemanifestv2) |
General Comments 0
You need to be logged in to leave comments.
Login now