##// END OF EJS Templates
addremove: pass unknown and deleted to findrenames directly again
Matt Mackall -
r8989:85b81cac default
parent child Browse files
Show More
@@ -265,14 +265,15 b' def matchall(repo):'
265 def matchfiles(repo, files):
265 def matchfiles(repo, files):
266 return _match.exact(repo.root, repo.getcwd(), files)
266 return _match.exact(repo.root, repo.getcwd(), files)
267
267
268 def findrenames(repo, match, threshold):
268 def findrenames(repo, added, removed, threshold):
269 '''find renamed files -- yields (before, after, score) tuples'''
269 '''find renamed files -- yields (before, after, score) tuples'''
270 added, removed = repo.status(match=match)[1:3]
271 ctx = repo['.']
270 ctx = repo['.']
272 for a in added:
271 for a in added:
273 aa = repo.wread(a)
272 aa = repo.wread(a)
274 bestname, bestscore = None, threshold
273 bestname, bestscore = None, threshold
275 for r in removed:
274 for r in removed:
275 if r not in ctx:
276 continue
276 rr = ctx.filectx(r).data()
277 rr = ctx.filectx(r).data()
277
278
278 # bdiff.blocks() returns blocks of matching lines
279 # bdiff.blocks() returns blocks of matching lines
@@ -322,7 +323,7 b' def addremove(repo, pats=[], opts={}, dr'
322 repo.remove(deleted)
323 repo.remove(deleted)
323 repo.add(unknown)
324 repo.add(unknown)
324 if similarity > 0:
325 if similarity > 0:
325 for old, new, score in findrenames(repo, m, similarity):
326 for old, new, score in findrenames(repo, unknown, deleted, similarity):
326 if repo.ui.verbose or not m.exact(old) or not m.exact(new):
327 if repo.ui.verbose or not m.exact(old) or not m.exact(new):
327 repo.ui.status(_('recording removal of %s as rename to %s '
328 repo.ui.status(_('recording removal of %s as rename to %s '
328 '(%d%% similar)\n') %
329 '(%d%% similar)\n') %
General Comments 0
You need to be logged in to leave comments. Login now