##// 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 def matchall(repo):
265 265 def matchfiles(repo, files):
266 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 269 '''find renamed files -- yields (before, after, score) tuples'''
270 added, removed = repo.status(match=match)[1:3]
271 270 ctx = repo['.']
272 271 for a in added:
273 272 aa = repo.wread(a)
274 273 bestname, bestscore = None, threshold
275 274 for r in removed:
275 if r not in ctx:
276 continue
276 277 rr = ctx.filectx(r).data()
277 278
278 279 # bdiff.blocks() returns blocks of matching lines
@@ -322,7 +323,7 def addremove(repo, pats=[], opts={}, dr
322 323 repo.remove(deleted)
323 324 repo.add(unknown)
324 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 327 if repo.ui.verbose or not m.exact(old) or not m.exact(new):
327 328 repo.ui.status(_('recording removal of %s as rename to %s '
328 329 '(%d%% similar)\n') %
General Comments 0
You need to be logged in to leave comments. Login now