Mercurial > public > mercurial-scm > hg
comparison mercurial/copies.py @ 24625:2cebf17c0fcc
copies: pass changectx instead of manifest to _computenonoverlap
The _computenonoverlap function takes two manifests to allow extensions to hook
in and read the manifest nodes produced by the function. The remotefilelog
extension actually needs the entire changectx instead (which includes the
manifest) so it can prefetch the subset of files necessary for a sparse checkout
(and the sparse checkout depends on which commit is being accessed, hence the
need for the changectx).
I have tests in the remotefilelog extension that cover this.
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 03 Apr 2015 15:18:34 -0700 |
parents | 1cfded2fa1a9 |
children | 4906dc0e038c |
comparison
equal
deleted
inserted
replaced
24624:6f0e6fa9fdd7 | 24625:2cebf17c0fcc |
---|---|
207 return _forwardcopies(x, y) | 207 return _forwardcopies(x, y) |
208 if a == y: | 208 if a == y: |
209 return _backwardrenames(x, y) | 209 return _backwardrenames(x, y) |
210 return _chain(x, y, _backwardrenames(x, a), _forwardcopies(a, y)) | 210 return _chain(x, y, _backwardrenames(x, a), _forwardcopies(a, y)) |
211 | 211 |
212 def _computenonoverlap(repo, m1, m2, addedinm1, addedinm2): | 212 def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2): |
213 """Computes, based on addedinm1 and addedinm2, the files exclusive to m1 | 213 """Computes, based on addedinm1 and addedinm2, the files exclusive to c1 |
214 and m2. This is its own function so extensions can easily wrap this call | 214 and c2. This is its own function so extensions can easily wrap this call |
215 to see what files mergecopies is about to process. | 215 to see what files mergecopies is about to process. |
216 | 216 |
217 Even though m1 and m2 are not used in this function, they are useful in | 217 Even though c1 and c2 are not used in this function, they are useful in |
218 other extensions for being able to read the file nodes of the changed files. | 218 other extensions for being able to read the file nodes of the changed files. |
219 """ | 219 """ |
220 u1 = sorted(addedinm1 - addedinm2) | 220 u1 = sorted(addedinm1 - addedinm2) |
221 u2 = sorted(addedinm2 - addedinm1) | 221 u2 = sorted(addedinm2 - addedinm1) |
222 | 222 |
308 | 308 |
309 repo.ui.debug(" searching for copies back to rev %d\n" % limit) | 309 repo.ui.debug(" searching for copies back to rev %d\n" % limit) |
310 | 310 |
311 addedinm1 = m1.filesnotin(ma) | 311 addedinm1 = m1.filesnotin(ma) |
312 addedinm2 = m2.filesnotin(ma) | 312 addedinm2 = m2.filesnotin(ma) |
313 u1, u2 = _computenonoverlap(repo, m1, m2, addedinm1, addedinm2) | 313 u1, u2 = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) |
314 | 314 |
315 for f in u1: | 315 for f in u1: |
316 ctx = setupctx(c1) | 316 ctx = setupctx(c1) |
317 checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy) | 317 checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy) |
318 | 318 |