[PATCH 4 of 8] manifest: add manifestlog.add
Durham Goode
durham at fb.com
Wed Sep 14 23:04:34 UTC 2016
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1473893509 25200
# Wed Sep 14 15:51:49 2016 -0700
# Node ID d41da1522f8efb5bf5aa75a51f0093b1129b6b5a
# Parent 9d358316e14c2a4f49c0ed7b3c25b4a53de4e433
manifest: add manifestlog.add
This adds a simple add() function to manifestlog. This let's us convert more
uses of repo.manifest to use repo.manifestlog, so we can further break our
dependency on the manifest class.
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1732,9 +1732,9 @@ class localrepository(object):
drop = [f for f in removed if f in m]
for f in drop:
del m[f]
- mn = self.manifest.add(m, trp, linkrev,
- p1.manifestnode(), p2.manifestnode(),
- added, drop)
+ mn = self.manifestlog.add(m, trp, linkrev,
+ p1.manifestnode(), p2.manifestnode(),
+ added, drop)
files = changed + removed
else:
mn = p1.manifestnode()
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1056,6 +1056,9 @@ class manifestlog(object):
self._mancache[node] = m
return m
+ def add(self, m, transaction, link, p1, p2, added, removed):
+ return self._revlog.add(m, transaction, link, p1, p2, added, removed)
+
class manifestctx(object):
"""A class representing a single revision of a manifest, including its
contents, its parent revs, and its linkrev.
More information about the Mercurial-devel
mailing list