Skip to content
Snippets Groups Projects
Commit bd19587a authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

revert: ensure that copies and renames are honored (issue3920)

Previously, we restored the states of files, but not the additional
information the dirstate uses to track copies and renames.
parent f4930b53
No related branches found
No related tags found
No related merge requests found
...@@ -2055,6 +2055,12 @@ ...@@ -2055,6 +2055,12 @@
checkout(f) checkout(f)
normal(f) normal(f)
copied = copies.pathcopies(repo[parent], ctx)
for f in add[0] + undelete[0] + revert[0]:
if f in copied:
repo.dirstate.copy(copied[f], f)
if targetsubs: if targetsubs:
# Revert the subrepos on the revert list # Revert the subrepos on the revert list
for sub in targetsubs: for sub in targetsubs:
......
...@@ -275,4 +275,28 @@ ...@@ -275,4 +275,28 @@
$ hg revert --no-backup ignored removed $ hg revert --no-backup ignored removed
$ hg st -mardi $ hg st -mardi
someone set up us the copies
$ rm .hgignore
$ hg update -C
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg mv ignored allyour
$ hg copy removed base
$ hg commit -m rename
copies and renames, you have no chance to survive make your time (issue3920)
$ hg update '.^'
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg revert -rtip -a
adding allyour
adding base
removing ignored
$ hg status -C
A allyour
ignored
A base
removed
R ignored
$ cd .. $ cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment