# HG changeset patch # User Siddharth Agarwal # Date 1360515301 0 # Node ID e556659340f09d504756de42f99c4ff71b2b063a # Parent de0bd4bfc6d7ae1a3364f4fbc0c9464c3cdd2acf manifestmerge: fix order in which manifests are fetched If the manifest of an earlier revision on the same delta chain is read before that of a later revision, the revlog remembers that we parsed the earlier revision and continues applying deltas from there onwards. If manifests are parsed the other way round, we have to start over from the fulltext. For a fresh clone of mozilla-central, updating from 29dd80c95b7d to its parent aab96936a177 requires approximately 400 fewer zlib.decompress calls, which results in a speedup from 1.10 seconds to 1.05. diff -r de0bd4bfc6d7 -r e556659340f0 mercurial/merge.py --- a/mercurial/merge.py Sun Feb 10 12:16:46 2013 +0000 +++ b/mercurial/merge.py Sun Feb 10 16:55:01 2013 +0000 @@ -196,6 +196,7 @@ overwrite = force and not branchmerge actions, copy, movewithdir = [], {}, {} + followcopies = False if overwrite: pa = wctx elif pa == p2: # backwards @@ -203,6 +204,13 @@ elif not branchmerge and not wctx.dirty(missing=True): pass elif pa and repo.ui.configbool("merge", "followcopies", True): + followcopies = True + + # manifests fetched in order are going to be faster, so prime the caches + [x.manifest() for x in + sorted(wctx.parents() + [p2, pa], key=lambda x: x.rev())] + + if followcopies: ret = copies.mergecopies(repo, wctx, p2, pa) copy, movewithdir, diverge, renamedelete = ret for of, fl in diverge.iteritems():