193 |
193 |
194 def _forwardcopies(a, b, match=None): |
194 def _forwardcopies(a, b, match=None): |
195 """find {dst@b: src@a} copy mapping where a is an ancestor of b""" |
195 """find {dst@b: src@a} copy mapping where a is an ancestor of b""" |
196 |
196 |
197 # check for working copy |
197 # check for working copy |
198 w = None |
|
199 if b.rev() is None: |
198 if b.rev() is None: |
200 w = b |
199 if a == b.p1(): |
201 b = w.p1() |
|
202 if a == b: |
|
203 # short-circuit to avoid issues with merge states |
200 # short-circuit to avoid issues with merge states |
204 return _dirstatecopies(w, match) |
201 return _dirstatecopies(b, match) |
205 |
202 |
206 cm = _committedforwardcopies(a, b, match) |
203 cm = _committedforwardcopies(a, b.p1(), match) |
207 |
204 # combine copies from dirstate if necessary |
208 # combine copies from dirstate if necessary |
205 return _chain(a, b, cm, _dirstatecopies(b, match)) |
209 if w is not None: |
206 return _committedforwardcopies(a, b, match) |
210 cm = _chain(a, w, cm, _dirstatecopies(w, match)) |
|
211 |
|
212 return cm |
|
213 |
207 |
214 def _backwardrenames(a, b): |
208 def _backwardrenames(a, b): |
215 if a._repo.ui.config('experimental', 'copytrace') == 'off': |
209 if a._repo.ui.config('experimental', 'copytrace') == 'off': |
216 return {} |
210 return {} |
217 |
211 |