comparison mercurial/cmdutil.py @ 16551:ebf6d38c9063 stable

localrepo: add setparents() to adjust dirstate copies (issue3407) The fix introduced in eab9119c5dee was only partially successful. It is correct to turn dirstate 'm' merge records into normal/dirty ones but copy records are lost in the process. To adjust them as well, we need to look in the first parent manifest to know which files were added and preserve only related records. But the dirstate does not have access to changesets, the logic has to moved at another level, in localrepo.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 29 Apr 2012 22:25:55 +0200
parents e596a631210e
children 9224cc2e99cc
comparison
equal deleted inserted replaced
16550:0d494a38c586 16551:ebf6d38c9063
1382 date=date, 1382 date=date,
1383 extra=extra) 1383 extra=extra)
1384 newid = repo.commitctx(new) 1384 newid = repo.commitctx(new)
1385 if newid != old.node(): 1385 if newid != old.node():
1386 # Reroute the working copy parent to the new changeset 1386 # Reroute the working copy parent to the new changeset
1387 repo.dirstate.setparents(newid, nullid) 1387 repo.setparents(newid, nullid)
1388 1388
1389 # Move bookmarks from old parent to amend commit 1389 # Move bookmarks from old parent to amend commit
1390 bms = repo.nodebookmarks(old.node()) 1390 bms = repo.nodebookmarks(old.node())
1391 if bms: 1391 if bms:
1392 for bm in bms: 1392 for bm in bms: