##// END OF EJS Templates
addremove: correctly handle intermediate symlinks...
Maxim Dounin -
r6651:7f0dd352 default
parent child Browse files
Show More
@@ -274,14 +274,20 b' def addremove(repo, pats=[], opts={}, dr'
274 similarity = float(opts.get('similarity') or 0)
274 similarity = float(opts.get('similarity') or 0)
275 add, remove = [], []
275 add, remove = [], []
276 mapping = {}
276 mapping = {}
277 audit_path = util.path_auditor(repo.root)
277 for src, abs, rel, exact in walk(repo, pats, opts):
278 for src, abs, rel, exact in walk(repo, pats, opts):
278 target = repo.wjoin(abs)
279 target = repo.wjoin(abs)
279 if src == 'f' and abs not in repo.dirstate:
280 good = True
281 try:
282 audit_path(abs)
283 except:
284 good = False
285 if src == 'f' and good and abs not in repo.dirstate:
280 add.append(abs)
286 add.append(abs)
281 mapping[abs] = rel, exact
287 mapping[abs] = rel, exact
282 if repo.ui.verbose or not exact:
288 if repo.ui.verbose or not exact:
283 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
289 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
284 if repo.dirstate[abs] != 'r' and (not util.lexists(target)
290 if repo.dirstate[abs] != 'r' and (not good or not util.lexists(target)
285 or (os.path.isdir(target) and not os.path.islink(target))):
291 or (os.path.isdir(target) and not os.path.islink(target))):
286 remove.append(abs)
292 remove.append(abs)
287 mapping[abs] = rel, exact
293 mapping[abs] = rel, exact
General Comments 0
You need to be logged in to leave comments. Login now