##// END OF EJS Templates
addremove: mapping isn't really needed, simplify
Benoit Boissinot -
r8488:4e1795cf default
parent child Browse files
Show More
@@ -286,7 +286,6 b' def addremove(repo, pats=[], opts={}, dr'
286 286 if similarity is None:
287 287 similarity = float(opts.get('similarity') or 0)
288 288 add, remove = [], []
289 mapping = {}
290 289 audit_path = util.path_auditor(repo.root)
291 290 m = match(repo, pats, opts)
292 291 for abs in repo.walk(m):
@@ -300,13 +299,11 b' def addremove(repo, pats=[], opts={}, dr'
300 299 exact = m.exact(abs)
301 300 if good and abs not in repo.dirstate:
302 301 add.append(abs)
303 mapping[abs] = rel, m.exact(abs)
304 302 if repo.ui.verbose or not exact:
305 303 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
306 304 if repo.dirstate[abs] != 'r' and (not good or not util.lexists(target)
307 305 or (os.path.isdir(target) and not os.path.islink(target))):
308 306 remove.append(abs)
309 mapping[abs] = rel, exact
310 307 if repo.ui.verbose or not exact:
311 308 repo.ui.status(_('removing %s\n') % ((pats and rel) or abs))
312 309 if not dry_run:
@@ -314,9 +311,9 b' def addremove(repo, pats=[], opts={}, dr'
314 311 repo.add(add)
315 312 if similarity > 0:
316 313 for old, new, score in findrenames(repo, add, remove, similarity):
317 oldrel, oldexact = mapping[old]
318 newrel, newexact = mapping[new]
314 oldexact, newexact = m.exact(old), m.exact(new)
319 315 if repo.ui.verbose or not oldexact or not newexact:
316 oldrel, newrel = m.rel(old), m.rel(new)
320 317 repo.ui.status(_('recording removal of %s as rename to %s '
321 318 '(%d%% similar)\n') %
322 319 (oldrel, newrel, score * 100))
General Comments 0
You need to be logged in to leave comments. Login now