Bug 2113 - copy + rename in a same transaction causes "detected divergent renames" warning
Summary: copy + rename in a same transaction causes "detected divergent renames" warning
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Thomas Arendsen Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-24 04:21 UTC by Charles-Henri d'Adhémar
Modified: 2012-07-30 10:37 UTC (History)
6 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 Charles-Henri d'Adhémar 2010-03-24 04:21 UTC
Hello,

When a file is copied and then renamed in the same commit we get
the "detected divergent renames" warning at each further pulls.

Expected behavior is either no warning at all or forbid the copy+rename in
the same transaction.

Related question : how to solve the issue ?

Please find below a use case to reproduce the problem.
Thank you very much for your help !

Cheers,
Charles-Henri.

# Test case using mercurial 1.5

hg init test
cd test
touch a
hg commit -A -m "add a"
cd ..
hg clone test test_copy_rename
cd test_copy_rename
hg cp a b
hg rename a c
hg commit -m "copy rename in one transaction"
cd ../test
hg pull -u ../test_copy_rename
pulling from ../test_copy_rename
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
warning: detected divergent renames of a to:
 b
 c
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
Comment 1 Matt Mackall 2010-11-10 02:19 UTC
Confirmed in 1.7
Comment 2 Bugzilla 2012-05-12 09:07 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:07 EDT  ---

This bug was previously known as _bug_ 2113 at http://mercurial.selenic.com/bts/issue2113
Comment 3 Thomas Arendsen Hein 2012-05-24 04:08 UTC
I pushed a fix to this to crew:
http://hg.intevation.org/mercurial/crew/rev/ad394c897b16
Comment 4 Thomas Arendsen Hein 2012-06-05 03:34 UTC
In main.
Comment 5 Matt Mackall 2012-07-29 15:00 UTC
Fixed in stable by

ad394c897b16 merge: do not warn about copy and rename in the same transaction
Comment 6 Thomas Arendsen Hein 2012-07-30 10:37 UTC
I guess we can go to resolved here.
I noticed this problem in some situations, but they were always with 2.2.x, not 2.3-rc. When doing the same steps with 2.3-rc, the warning did not happen.