Martin von Zweigbergk <martinvonz@google.com> [Mon, 16 Mar 2015 16:01:16 -0700] rev 24406
treemanifest: make hasdir() faster
Same rationale as the previous change.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Mar 2015 13:50:06 -0800] rev 24405
treemanifest: make filesnotin() faster
Same rationale as the previous change.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 19 Feb 2015 17:13:35 -0800] rev 24404
treemanifest: make diff() faster
Containment checking is slower in treemanifest than it is in
manifestdict, making the current diff algorithm O(n log n). By
traversing both treemanifests in parallel, we can make it O(n). More
importantly, once we start lazily loading submanifests, we will be
able to easily skip entire submanifest if they have the same nodeid.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 23 Feb 2015 10:57:57 -0800] rev 24403
treemanifest: store directory path in treemanifest nodes
This leads to less concatenation while iterating, and it's useful for
debugging.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 19 Mar 2015 11:07:57 -0700] rev 24402
treemanifest: add configuration for using treemanifest type
This change adds boolean configuration option
experimental.treemanifest. When the option is enabled, manifests are
parsed into the new treemanifest type.
Tests can be now run using treemanifest by switching the config option
default in localrepo._applyrequirements(). Tests pass even when made
to randomly choose between manifestdict and treemanifest, suggesting
that the two types produce identical manifests (so e.g. a manifest
revlog entry written from a treemanifest can be parsed by the
manifestdict code).
Martin von Zweigbergk <martinvonz@google.com> [Thu, 19 Mar 2015 11:08:42 -0700] rev 24401
treemanifest: create treemanifest class
There are a number of problems with large and flat manifests. Copying
from http://mercurial.selenic.com/wiki/ManifestShardingPlan:
* manifest too large for RAM
* manifest resolution too much CPU (long delta chains)
* committing is slow because entire manifest has to be hashed
* impossible for narrow clone to leave out part of manifest as all is
needed to calculate new hash
* diffing two revisions involves traversing entire subdirectories
even if identical
This is a first step in a series introducing a manifest revlog per
directory.
This change adds a new manifest class: treemanifest, which is a tree
where each node has a dict of files (nodeids), a dict of flags, and a
dict of subdirectories (treemanifests). So far, it behaves just like
manifestdict, but it will later help us write one manifest revlog per
directory. The new class is still unused; it will be used after the
next change.
The code is not yet optimized. Running with it (see below) makes most
or all operations slower. Once we start storing manifest revlogs for
every directory, it should be possible to make many of these
operations much faster. The fastdelta() optimization has been
intentionally not implemented for the treemanifests. We can implement
it later if necessary.
All tests pass when run with the following patch (and without, of
couse):
--- a/mercurial/manifest.py Thu Mar 19 11:08:42 2015 -0700
+++ b/mercurial/manifest.py Thu Mar 19 11:15:50 2015 -0700
@@ -596,7 +596,7 @@ class manifest(revlog.revlog):
return None, None
def add(self, m, transaction, link, p1, p2, added, removed):
- if p1 in self._mancache:
+ if False and p1 in self._mancache:
# If our first parent is in the manifest cache, we can
# compute a delta here using properties we know about the
# manifest up-front, which may save time later for the
@@ -626,3 +626,5 @@ class manifest(revlog.revlog):
self._mancache[n] = (m, arraytext)
return n
+
+manifestdict = treemanifest
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 19 Mar 2015 23:36:06 +0900] rev 24400
bookmarks: rewrite comparing bookmarks in commands.summary() by compare()
This patch adds utility function "summary()", to replace comparing
bookmarks in "commands.summary()". This replacement finishes
centralizing the logic to compare bookmarks into "bookmarks.compare()".
This patch also adds test to check summary output with
incoming/outgoing bookmarks, because "hg summary --remote" is not
tested yet on the repository with incoming/outgoing bookmarks.
This test uses "(glob)" to ignore summary about incoming/outgoing
changesets.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 19 Mar 2015 23:36:05 +0900] rev 24399
bookmarks: remove useless diff()
Previous patches removed code paths referring it.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 19 Mar 2015 23:36:05 +0900] rev 24398
bookmarks: add outgoing() to replace diff() for outgoing bookmarks
This replacement makes enhancement of "show outgoing bookmarks" easy,
because "compare()" can detect more detailed difference of bookmarks
between two repositories.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 19 Mar 2015 23:36:05 +0900] rev 24397
bookmarks: add incoming() to replace diff() for incoming bookmarks
This replacement makes enhancement of "show incoming bookmarks" easy,
because "compare()" can detect more detailed difference of bookmarks
between two repositories.