[PATCH 07 of 10] manifest: add unionmanifestlog support
Durham Goode
durham at fb.com
Wed Nov 9 14:31:21 EST 2016
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1478684921 28800
# Wed Nov 09 01:48:41 2016 -0800
# Node ID 986cd0563b1c95d7a221af9a7eb9742d0e5ad550
# Parent 04ec4875fac7d14c91e82525cc40b8e7084e673a
manifest: add unionmanifestlog support
As part of deprecating manifest, we need to make the union repo support
manifestlog.
diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -152,18 +152,23 @@ class unionchangelog(unionrevlog, change
def baserevdiff(self, rev1, rev2):
return changelog.changelog.revdiff(self, rev1, rev2)
-class unionmanifest(unionrevlog, manifest.manifest):
+class unionmanifestlog(manifest.manifestlog):
+ def __init__(self, opener, repo, opener2, linkmapper):
+ manifest.manifestlog.__init__(self, opener, repo)
+ self._revlog = unionmanifest(opener, opener2, linkmapper)
+
+class unionmanifest(unionrevlog, manifest.manifestrevlog):
def __init__(self, opener, opener2, linkmapper):
- manifest.manifest.__init__(self, opener)
- manifest2 = manifest.manifest(opener2)
+ manifest.manifestrevlog.__init__(self, opener)
+ manifest2 = manifest.manifestrevlog(opener2)
unionrevlog.__init__(self, opener, self.indexfile, manifest2,
linkmapper)
def baserevision(self, nodeorrev):
- return manifest.manifest.revision(self, nodeorrev)
+ return manifest.manifestrevlog.revision(self, nodeorrev)
def baserevdiff(self, rev1, rev2):
- return manifest.manifest.revdiff(self, rev1, rev2)
+ return manifest.manifestrevlog.revdiff(self, rev1, rev2)
class unionfilelog(unionrevlog, filelog.filelog):
def __init__(self, opener, path, opener2, linkmapper, repo):
@@ -212,6 +217,11 @@ class unionrepository(localrepo.localrep
return unionmanifest(self.svfs, self.repo2.svfs,
self.unfiltered()._clrev)
+ @localrepo.unfilteredpropertycache
+ def manifestlog(self):
+ return unionmanifestlog(self.svfs, self, self.repo2.svfs,
+ self.unfiltered()._clrev)
+
def url(self):
return self._url
More information about the Mercurial-devel
mailing list