merge lies about lacking common ancestors when it has multiple choices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When two branches have multiple common ancestors, merge lies through its teeth and says there are none:
bzr: ERROR: Branches have no common ancestor, and no merge base revision was specified.
#!/bin/sh -ex
bzr="/usr/
if [ -d base1 -o -d base2 -o -d p1 -o -d p2 ]; then
echo "Cleanup plz"
exit
fi
# Make 2 base branches
for i in 1 2; do
${bzr} init base${i}
(
cd base${i} ;
touch b${i}_x ;
${bzr} add b${i}_x ;
${bzr} ci -m "b${i}_x" ;
)
done
# Make two work branches, both based on both bases, each with their own work
for i in 1 2; do
${bzr} branch base1 p${i}
(
cd p${i} ;
${bzr} merge -r0..-1 ../base2 ;
${bzr} ci -m 'merge base2' ;
touch p${i}_x ;
${bzr} add p${i}_x ;
${bzr} ci -m "p${i}_x"
)
done
# Now try and merge them together
(
cd p1 ;
${bzr} merge ../p2
# There wasn't supposed to be an earth-shattering KA-BOOM!
)
Thanks for the script, I can reproduce this.
This appears to be a criss-cross, but of two revisions that have no parents (other than null:). So in a sense the LCA is null:, which the logic then interprets as no LCA.
Bad ascii art:
P1 P2
| |
M1 M2
| \ /|
| x |
| / \|
B1 B2
(or just run "bzr qlog p1 p2" after running fullermd's shell script)