Cannot merge -r 0..-1 in an empty branch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
New
|
Undecided
|
Unassigned |
Bug Description
I sometimes use `bzr merge -r 0..-1` to merge a branch with some files
on top on another branch which I now want to contain those files.
Today I wanted to do that, in an empty branch. And it didn't work. I
know it's something omewhat strange to do, but maybe it ought to work?
This works:
% bzr init bin
% cd bin
% bzr ci --unchanged -m 'Work around bug.'
% bzr merge -r 0..-1 ../misc
% bzr st
added:
foo
bar
pending merges:
[etc.]
Without the dummy commit:
% bzr init bin
% cd bin
% bzr merge -r 0..-1 ../misc
% bzr st
working tree is out of date, run 'bzr update'
% bzr update
-D foo
-D bar
All changes applied successfully.
bzr: ERROR: Reserved revision-id {null:}
% bzr st
working tree is out of date, run 'bzr update'
removed:
foo
bar
affects /products/bzr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adeodato Simó wrote:
> Public bug reported:
>
> I sometimes use `bzr merge -r 0..-1` to merge a branch with some files
> on top on another branch which I now want to contain those files.
>
> Today I wanted to do that, in an empty branch. And it didn't work. I
> know it's something omewhat strange to do, but maybe it ought to work?
It can't work with our current way of representing working directories
and revisions.
The last-committed revision is *usually* listed as parent[0], and merges
are listed as parent[1:]. But in a tree with no commits, there are *no*
parents, and so if you do a merge, that becomes parent[0]. We should
probably disallow merge in that case, since you'll get wacky behavior.
In theory, this could be fixed by changing our working tree and revision
representations to list null: as a parent, but it seems like a lot of
work for a corner case like this.
> % bzr update
> -D foo
> -D bar
> All changes applied successfully.
> bzr: ERROR: Reserved revision-id {null:}
^^ This bug should be fixed.
Aaron enigmail. mozdev. org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFHXaCY0F+ nu1YWqI0RAmRoAK CC8Z06n5FGHaMC7 UZSzW6r9YbehwCg gLcg gpzmNU1A=
UHoYMcQtr3oBr68
=TvN9
-----END PGP SIGNATURE-----