##// END OF EJS Templates
copies: extract method for getting non-wdir forward copies...
Martin von Zweigbergk -
r35423:8801cdce default
parent child Browse files
Show More
@@ -156,18 +156,8 b' def _computeforwardmissing(a, b, match=N'
156 156 mb = b.manifest()
157 157 return mb.filesnotin(ma, match=match)
158 158
159 def _forwardcopies(a, b, match=None):
160 """find {dst@b: src@a} copy mapping where a is an ancestor of b"""
161
162 # check for working copy
163 w = None
164 if b.rev() is None:
165 w = b
166 b = w.p1()
167 if a == b:
168 # short-circuit to avoid issues with merge states
169 return _dirstatecopies(w, match)
170
159 def _committedforwardcopies(a, b, match):
160 """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""
171 161 # files might have to be traced back to the fctx parent of the last
172 162 # one-side-only changeset, but not further back than that
173 163 limit = _findlimit(a._repo, a.rev(), b.rev())
@@ -199,6 +189,21 b' def _forwardcopies(a, b, match=None):'
199 189 ofctx = _tracefile(fctx, am, limit)
200 190 if ofctx:
201 191 cm[f] = ofctx.path()
192 return cm
193
194 def _forwardcopies(a, b, match=None):
195 """find {dst@b: src@a} copy mapping where a is an ancestor of b"""
196
197 # check for working copy
198 w = None
199 if b.rev() is None:
200 w = b
201 b = w.p1()
202 if a == b:
203 # short-circuit to avoid issues with merge states
204 return _dirstatecopies(w, match)
205
206 cm = _committedforwardcopies(a, b, match)
202 207
203 208 # combine copies from dirstate if necessary
204 209 if w is not None:
General Comments 0
You need to be logged in to leave comments. Login now