confusing status/diff output when merging two trees with the same file added on each side
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
John A Meinel |
Bug Description
If you add the same file in 2 branches and then merge them, you get the standard 'files conflict' and one gets a '.moved' path.
However, in 0.15+ (also tested with bzr.dev 2464) it marks the original file as 'unknown'.
Steps to reproduce:
bzr init A
cd A
touch one
bzr add one
bzr commit -m 1
bzr branch . ../B
touch two
bzr add two
bzr commit -m 2
cd ../B
touch two
bzr add two
bzr commit -m 'alt 2'
bzr merge ../A
At this point you get a file path conflict with bzr merge reporting:
+N two
R two => two.moved
Conflict adding file two. Moved existing file to two.moved.
1 conflicts encountered.
and bzr status reports:
renamed:
two => two.moved
unknown:
two
conflicts:
Conflict adding file two. Moved existing file to two.moved.
pending merges:
John Arbash Meinel 2006-11-25 2
Colin originally reported the same reproducable bug from:
bzr get -r140 http://
bzr get -r146 http://
cd ubuntu
bzr merge -r146 ../main
...
I tried to merge this as follows:
$ bzr merge -r146 ../main
+N HACKING
+N src/system/
+N src/system/
+N src/system/
M configure.ac
M debian/changelog
M src/system/
-D src/system/
M src/system/
R src/system/
Text conflict in configure.ac
Text conflict in debian/changelog
Conflict adding file src/system/
3 conflicts encountered.
That's fine - these conflicts are expected. But:
$ bzr renames
src/system/
$ bzr added
src/system/
HACKING
src/system/
src/system/
$ bzr status
[...]
renamed:
src/system/
[...]
unknown:
[...]
src/system/
What's going on? Why does 'bzr added' say it's been added, but 'bzr status' say it's unknown? Likewise, 'bzr diff' doesn't show the added file. I did 'rm src/system/
$ bzr commit -m 'merge from Debian 0.51'
missing src/system/
added HACKING
modified configure.ac
modified debian/changelog
modified src/system/
added src/system/
added src/system/
modified src/system/
added src/system/
deleted src/system/
deleted src/system/
Committed revision 141.
After this, the branch now does seem to be in the right state. However, I'm used to relying on the status output to reassure me that the right thing is going to be committed, and it definitely failed to reassure me here.
I'm using bzr 0.15.0 and had fully upgraded branch formats throughout.
Related branches
Changed in bzr: | |
status: | Fix Committed → Fix Released |
Hi Robert,
I ran a bzr.dev selftest got a trace back that ask to be sent to bazaar ubuntu
if I could help let me know it's not as simple for some of us.
best regards
bubba
On 4/26/07, Colin Watson <email address hidden> wrote: bazaar. launchpad. net/~ubuntu- core-dev/ libdebian- bazaar. launchpad. net/~vcs- imports/ libdebian- subarch- x86-linux. c, was subarch- armeb-linux. c subarch- armel-linux. c@ subarch- x86-linux. c Makefile. am subarch- armeb-linux. c subarch- powerpc- linux.c subarch- x86-linux. c => src/system/ subarch- x86-linux. c.moved subarch- x86-linux. c. Moved existing file to src/system/ subarch- x86-linux. c.moved. subarch- x86-linux. c => src/system/ subarch- x86-linux. c.moved subarch- armeb-linux. c subarch- x86-linux. c subarch- armel-linux. c subarch- x86-linux. c => src/system/ subarch- x86-linux. c.moved subarch- x86-linux. c subarch- x86-linux. c.moved; bzr resolve subarch- x86-linux. c', and this resolves the conflict but subarch- x86-linux. c.moved Makefile. am subarch- armeb-linux. c subarch- armel-linux. c subarch- powerpc- linux.c subarch- x86-linux. c subarch- armeb-linux. c subarch- x86-linux. c
> Public bug reported:
>
> I'm working on http://
> installer/ubuntu/ (at revision 140), and was trying to merge up to
> revision 146 of http://
> installer/main/. The same file, src/system/
> added (as it happens, with the same contents) in both branches after the
> last merge, and now I'd like to end up with the vcs-imports file-id in
> both branches so that future merges are straightforward. This is a
> fairly normal thing to happen for me when I add a file both in Ubuntu
> and in the upstream Subversion repository, usually because the Ubuntu
> release cycle is at a point where I can't just do it upstream and wait
> for it to land.
>
> I tried to merge this as follows:
>
> $ bzr merge -r146 ../main
> +N HACKING
> +N src/system/
> +N src/system/
> +N src/system/
> M configure.ac
> M debian/changelog
> M src/system/
> -D src/system/
> M src/system/
> R src/system/
> Text conflict in configure.ac
> Text conflict in debian/changelog
> Conflict adding file src/system/
> 3 conflicts encountered.
>
> That's fine - these conflicts are expected. But:
>
> $ bzr renames
> src/system/
> $ bzr added
> src/system/
> HACKING
> src/system/
> src/system/
> $ bzr status
> [...]
> renamed:
> src/system/
> [...]
> unknown:
> [...]
> src/system/
>
> What's going on? Why does 'bzr added' say it's been added, but 'bzr
> status' say it's unknown? Likewise, 'bzr diff' doesn't show the added
> file. I did 'rm src/system/
> src/system/
> still shows the file as unknown in status output. Eventually I decided
> to try committing it anyway and got:
>
> $ bzr commit -m 'merge from Debian 0.51'
> missing src/system/
> added HACKING
> modified configure.ac
> modified debian/changelog
> modified src/system/
> added src/system/
> added src/system/
> modified src/system/
> added src/system/
> deleted src/system/
> deleted src/system/
> Committed revision 141.
>
> After this, the branch now does seem to be in the right state. However,
> I'm used to relying on the status output to reassure me that the right
> thing is going to be committed, and it definitely failed to reassure me
> here.
>
> I'm using bzr 0.15.0 and ha...