Bug 3920 - revert does not restore copy info
Summary: revert does not restore copy info
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 2.6
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks: 3919
  Show dependency tree
 
Reported: 2013-05-03 00:37 UTC by Bryan O'Sullivan
Modified: 2013-07-23 18:33 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan O'Sullivan 2013-05-03 00:37 UTC
Easy repro. First the setup:

hg init a
cd a
echo a>a
hg commit -A -m a
hg rename a b
hg commit -m b

Then the bug:

hg update 0
hg revert -r 1 -a
hg status -C

This correctly identifies "a" as removed and "b" as added, but does not indicate that "a" was in fact renamed to "b".

So we get this output:

A b
R a

We should have gotten this:

A b
  a
R a
Comment 1 HG Bot 2013-05-03 16:45 UTC
Fixed by http://selenic.com/repo/hg/rev/bd19587a3347
Bryan O'Sullivan <bryano@fb.com>
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.

(please test the fix)