comparison mercurial/cmdutil.py @ 5483:0c43f87baba3 default tip

Fix file-changed-to-dir and dir-to-file commits (issue660). Allow adding to dirstate files that clash with previously existing but marked for removal. Protect from reintroducing clashes by revert. This change doesn't address related issues with update. Current workaround is to do "clean" update by manually removing conflicting files/dirs from working directory.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 27 Oct 2007 16:27:55 +0400
parents 5517aa5aafb0
children
comparison
equal deleted inserted replaced
5482:7ceb740f2fef 5483:0c43f87baba3
264 if src == 'f' and abs not in repo.dirstate: 264 if src == 'f' and abs not in repo.dirstate:
265 add.append(abs) 265 add.append(abs)
266 mapping[abs] = rel, exact 266 mapping[abs] = rel, exact
267 if repo.ui.verbose or not exact: 267 if repo.ui.verbose or not exact:
268 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) 268 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
269 if repo.dirstate[abs] != 'r' and not util.lexists(target): 269 if repo.dirstate[abs] != 'r' and (not util.lexists(target)
270 or (os.path.isdir(target) and not os.path.islink(target))):
270 remove.append(abs) 271 remove.append(abs)
271 mapping[abs] = rel, exact 272 mapping[abs] = rel, exact
272 if repo.ui.verbose or not exact: 273 if repo.ui.verbose or not exact:
273 repo.ui.status(_('removing %s\n') % ((pats and rel) or abs)) 274 repo.ui.status(_('removing %s\n') % ((pats and rel) or abs))
274 if not dry_run: 275 if not dry_run:
276 repo.remove(remove)
275 repo.add(add) 277 repo.add(add)
276 repo.remove(remove)
277 if similarity > 0: 278 if similarity > 0:
278 for old, new, score in findrenames(repo, add, remove, similarity): 279 for old, new, score in findrenames(repo, add, remove, similarity):
279 oldrel, oldexact = mapping[old] 280 oldrel, oldexact = mapping[old]
280 newrel, newexact = mapping[new] 281 newrel, newexact = mapping[new]
281 if repo.ui.verbose or not oldexact or not newexact: 282 if repo.ui.verbose or not oldexact or not newexact: