##// END OF EJS Templates
copies: extract function for deciding whether to use changeset-centric algos...
Martin von Zweigbergk -
r42284:27475ae6 default
parent child Browse files
Show More
@@ -160,13 +160,18 b' def _computeforwardmissing(a, b, match=N'
160 mb = b.manifest()
160 mb = b.manifest()
161 return mb.filesnotin(ma, match=match)
161 return mb.filesnotin(ma, match=match)
162
162
163 def usechangesetcentricalgo(repo):
164 """Checks if we should use changeset-centric copy algorithms"""
165 return (repo.ui.config('experimental', 'copies.read-from') ==
166 'compatibility')
167
163 def _committedforwardcopies(a, b, match):
168 def _committedforwardcopies(a, b, match):
164 """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""
169 """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""
165 # files might have to be traced back to the fctx parent of the last
170 # files might have to be traced back to the fctx parent of the last
166 # one-side-only changeset, but not further back than that
171 # one-side-only changeset, but not further back than that
167 repo = a._repo
172 repo = a._repo
168
173
169 if repo.ui.config('experimental', 'copies.read-from') == 'compatibility':
174 if usechangesetcentricalgo(repo):
170 return _changesetforwardcopies(a, b, match)
175 return _changesetforwardcopies(a, b, match)
171
176
172 debug = repo.ui.debugflag and repo.ui.configbool('devel', 'debug.copies')
177 debug = repo.ui.debugflag and repo.ui.configbool('devel', 'debug.copies')
@@ -1205,7 +1205,7 b' def _markchanges(repo, unknown, deleted,'
1205 wctx.copy(old, new)
1205 wctx.copy(old, new)
1206
1206
1207 def getrenamedfn(repo, endrev=None):
1207 def getrenamedfn(repo, endrev=None):
1208 if repo.ui.config('experimental', 'copies.read-from') == 'compatibility':
1208 if copiesmod.usechangesetcentricalgo(repo):
1209 def getrenamed(fn, rev):
1209 def getrenamed(fn, rev):
1210 ctx = repo[rev]
1210 ctx = repo[rev]
1211 p1copies = ctx.p1copies()
1211 p1copies = ctx.p1copies()
General Comments 0
You need to be logged in to leave comments. Login now