how do I commit somewhere other than onto a tip?
Lukáš Lalinský
lalinsky at gmail.com
Sat Oct 4 07:56:06 BST 2008
On Sat, Oct 4, 2008 at 1:26 AM, Vincent Broman <broman at spawar.navy.mil> wrote:
> Meinel suggested something similar, but here is the problem:
> Say I have versions A,B,C
>
> A -> B -> C
>
> Now I commit AA which is supposed to be a successor of A and predecessor of B.
>
> A -> B -> C
> -> AA
>
> There is a diff from A to B and a diff from A to AA, but
> nowhere is there a diff from AA to B.
> If I do a merge, the result will not be equal to B or C.
> If I rewind to
>
> A -> AA
>
> and then replay here the diff of A to B, I don't end up with B.
> If I just commit a copy of B after AA, then I get
>
> A -> AA -> B
>
> which is right, except this B is not the ancestor of C.
> I think this leads to redoing all the commits that I had following B, by hand.
/tmp$ bzr init branch1
Standalone tree (format: pack-0.92)
Location:
branch root: branch1
/tmp$ cd branch1/
/tmp/branch1$ bzr ci -m 'A' --unchanged
Committing to: /tmp/branch1/
Committed revision 1.
/tmp/branch1$ bzr ci -m 'B' --unchanged
Committing to: /tmp/branch1/
Committed revision 2.
/tmp/branch1$ bzr ci -m 'C' --unchanged
Committing to: /tmp/branch1/
Committed revision 3.
/tmp/branch1$ bzr log --line
3: Lukáš Lalinský 2008-10-04 C
2: Lukáš Lalinský 2008-10-04 B
1: Lukáš Lalinský 2008-10-04 A
/tmp/branch1$ cd ..
/tmp$ bzr branch -r 1 branch1 branch2
Branched 1 revision(s).
/tmp$ cd branch2/
/tmp/branch2$ bzr ci -m 'AA' --unchanged
Committing to: /tmp/branch2/
Committed revision 2.
/tmp/branch2$ bzr replay ../branch1/ -r2..3
All changes applied successfully.
Committing to: /tmp/branch2/
Committed revision 3.
All changes applied successfully.
Committing to: /tmp/branch2/
Committed revision 4.
/tmp/branch2$ bzr log --line
4: Lukáš Lalinský 2008-10-04 C
3: Lukáš Lalinský 2008-10-04 B
2: Lukáš Lalinský 2008-10-04 AA
1: Lukáš Lalinský 2008-10-04 A
One thing you should note is that you will _never_ get the original
revisions B and C in the new branch, if you insert a revision in
between. The revision list is actually a revision graph, and one
revision depends on another. The new revisions looks identically, but
have different IDs. So as you can see, doing this on a public branch
is going to would lead to diverged branches for everybody following
the branch.
Lukas
More information about the bazaar
mailing list