Bug 3266 - graft does not record origin of copy
Summary: graft does not record origin of copy
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-13 09:54 UTC by Jesse Glick
Modified: 2012-05-13 04:52 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 Jesse Glick 2012-02-13 09:54 UTC
In http://hg.netbeans.org/releases/ there is a cset 287a221bbd83 on the 
default branch which involves a couple of copy-and-modifies:

diff --git 
a/apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/Inst
allerPanel.java 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/InstallerPanel.
java
copy from 
apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/Instal
lerPanel.java
copy to 
maven.apisupport/src/org/netbeans/modules/maven/apisupport/InstallerPanel.ja
va
--- 
a/apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/Inst
allerPanel.java
+++ 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/InstallerPanel.
java
....

Using Hg 2.0.2 I grafted this to the release71_fixes branch, resulting in 
768529630e81, which does not show the new file as a copy:

diff --git 
a/maven.apisupport/src/org/netbeans/modules/maven/apisupport/InstallerPanel.
java 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/InstallerPanel.
java
new file mode 100644
--- /dev/null
+++ 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/InstallerPanel.
java
....

Note that the same operation using the Transplant extension correctly 
records the copy origin, so this is a "regression" if you treat graft as a 
replacement for transplant.
Comment 1 Matt Mackall 2012-02-13 14:03 UTC
Please try again with 2.1, which rewrote most of the code dealing with
copies for rebase/graft/diff.
Comment 2 Jesse Glick 2012-02-13 17:48 UTC
Same bug seems to exist in 2.1.
Comment 3 Matt Mackall 2012-02-24 15:16 UTC
Confirmed. Problem affects graft but not rebase. Test script:

hg init a
cd a

echo a > a
hg ci -Am0
echo b > a
hg ci -Am1
echo c > b
hg ci -Am2

hg up 1
hg mv a x
echo x > x
hg ci -Am3

hg up 2
hg export -g tip
Comment 4 HG Bot 2012-02-24 17:00 UTC
Fixed by http://selenic.com/repo/hg/rev/807f796e9b1a
Matt Mackall <mpm@selenic.com>
graft: use proper revisions for copy detection (issue3265)

(please test the fix)
Comment 5 Bugzilla 2012-05-12 09:28 UTC

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

This bug was previously known as _bug_ 3265 at http://mercurial.selenic.com/bts/issue3265