comparison mercurial/merge.py @ 18651:e556659340f0

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.
author Siddharth Agarwal <sid0@fb.com>
date Sun, 10 Feb 2013 16:55:01 +0000
parents de0bd4bfc6d7
children 1ef89df2c248
comparison
equal deleted inserted replaced
18650:de0bd4bfc6d7 18651:e556659340f0
194 """ 194 """
195 195
196 overwrite = force and not branchmerge 196 overwrite = force and not branchmerge
197 actions, copy, movewithdir = [], {}, {} 197 actions, copy, movewithdir = [], {}, {}
198 198
199 followcopies = False
199 if overwrite: 200 if overwrite:
200 pa = wctx 201 pa = wctx
201 elif pa == p2: # backwards 202 elif pa == p2: # backwards
202 pa = wctx.p1() 203 pa = wctx.p1()
203 elif not branchmerge and not wctx.dirty(missing=True): 204 elif not branchmerge and not wctx.dirty(missing=True):
204 pass 205 pass
205 elif pa and repo.ui.configbool("merge", "followcopies", True): 206 elif pa and repo.ui.configbool("merge", "followcopies", True):
207 followcopies = True
208
209 # manifests fetched in order are going to be faster, so prime the caches
210 [x.manifest() for x in
211 sorted(wctx.parents() + [p2, pa], key=lambda x: x.rev())]
212
213 if followcopies:
206 ret = copies.mergecopies(repo, wctx, p2, pa) 214 ret = copies.mergecopies(repo, wctx, p2, pa)
207 copy, movewithdir, diverge, renamedelete = ret 215 copy, movewithdir, diverge, renamedelete = ret
208 for of, fl in diverge.iteritems(): 216 for of, fl in diverge.iteritems():
209 actions.append((of, "dr", (fl,), "divergent renames")) 217 actions.append((of, "dr", (fl,), "divergent renames"))
210 for of, fl in renamedelete.iteritems(): 218 for of, fl in renamedelete.iteritems():