[MERGE REQUEST] merge work
John A Meinel
john at arbash-meinel.com
Wed Aug 17 18:46:51 BST 2005
Don't forget to "reply all" so that the list is included.
Erik Bågfors wrote:
> 2005/8/17, John A Meinel <john at arbash-meinel.com>:
>
>>Erik Bågfors wrote:
>>
>>>What about pulling after merging. What I mean is this
>>
>>Short answer: it should work. :)
>>
>>The official statement is that you can pull a revision if the current
>>revision is in the parents of the revision being pulled.
>>
>>In your case:
>>
>>
>>Branch1 (parent)
>> A None
>> B A
>> C1 B
>> D1 C1
>> C2D2Merge D1,D2
>>
>>At this point Branch2 has:
>> A None
>> B A
>> C2 B
>> D2 C2
>>
>>Now, if Branch2 just did "cd branch2; bzr pull ../branch1" it should
>>work. Because D2 is one of the parents of C2D2Merge in fact, it should
>>just look like this:
>> A None
>> B A
>> C2 B
>> D2 C2
>> C2D2Merge D1,D2
>>
>>(Notice that it is the exact revision name).
>>You shouldn't have to merge anything back.
>>Now, what we really want is something like this:
>>
>>Branch1: A, B, C1, D1, C2D2Merge, E1, F1
>>Branch2: A, B, C2, D2
>>
>>cd Branch2; bzr pull ../Branch1
>>Branch2: A, B, C2, D2, C2D2Merge, E1, F1
>
>
> Hmm... where did C1 and D1 go? I would expect them to get pulled as well?
They should be in the revision store, and show up as parents of
C2D2Merge, but they won't be in the revision-history.
>
> Can you show me this in command-lines? I would expect the following to
> work if I understand your explaination. Sorry about the long dump from
> my command line...
Your commands look correct. I should have prefixed this with "I don't
believe this has been fully implemented yet".
Right now "bzr pull" only pays attention to having the end of a matching
section of revision-history be the same. (Meaning take the 2 histories,
whichever one is shorter that revno should be the same in both histories).
*Right now* there is no way to merge a branch so that you can get back
to "bzr pull" working.
I was discussing more the "design" of the system.
It really shouldn't be that hard to make it work, it is just an issue of
making 'bzr pull' a little bit smarter about what is okay to pull.
Basically, instead of checking to see if the last equivalent
revision-history entry is the same, it should check to see if the first
new revision has the current revision as a parent.
It seems easy enough to implement if this is important for you. I think
it would make some of the bzr-mainline development easier.
Sorry about not having it implemented yet. I think the current work is
being done to make sure that "bzr merge" works correctly under all
cases, and creates the correct entries for the ancestry so that the
future "bzr pull" can just work.
John
=:->
>
> erik at mythtv:~/t $ mkdir branch1
> erik at mythtv:~/t $ cd branch1/
> erik at mythtv:~/t/branch1 $ bzr init
> erik at mythtv:~/t/branch1 $ cp /etc/passwd .
> erik at mythtv:~/t/branch1 $ bzr add passwd
> added passwd
> erik at mythtv:~/t/branch1 $ bzr commit -m A
> * looking for changes...
> added passwd
> * commited r1
> erik at mythtv:~/t/branch1 $ perl -i -pe 's/saned/tjoho/' passwd
> erik at mythtv:~/t/branch1 $ bzr commit -m B
> * looking for changes...
> modified passwd
> * commited r2
>
> erik at mythtv:~/t/branch1 $ cd ..
> erik at mythtv:~/t $ bzr branch branch1 branch2
> Added 2 texts.
> Added 2 inventories.
> Added 2 revisions.
>
> erik at mythtv:~/t $ cd branch1/
> erik at mythtv:~/t/branch1 $ cp /etc/hosts .
> erik at mythtv:~/t/branch1 $ bzr add hosts
> added hosts
> erik at mythtv:~/t/branch1 $ bzr commit -m C1
> * looking for changes...
> added hosts
> * commited r3
> erik at mythtv:~/t/branch1 $ perl -i -pe s/localhost/lokalhost/ hosts
> erik at mythtv:~/t/branch1 $ bzr commit -m D1
> * looking for changes...
> modified hosts
> * commited r4
>
> erik at mythtv:~/t/branch1 $ cd ../branch2/
> erik at mythtv:~/t/branch2 $ cp /etc/motd .
> erik at mythtv:~/t/branch2 $ bzr add motd
> added motd
> erik at mythtv:~/t/branch2 $ bzr commit -m C2
> * looking for changes...
> added motd
> * commited r3
> erik at mythtv:~/t/branch2 $ perl -i -pe 's/Ubuntu/Ubuntu rules/' motd
> erik at mythtv:~/t/branch2 $ bzr commit -m 'D2'
> * looking for changes...
> modified motd
> * commited r4
> erik at mythtv:~/t/branch2 $ cd ../branch1/
> erik at mythtv:~/t/branch1 $ bzr merge ../branch2
> 0 conflicts encountered.
> erik at mythtv:~/t/branch1 $ bzr commit -m merge
> * looking for changes...
> added motd
> * commited r5
> erik at mythtv:~/t/branch1 $ cd ../branch2/
> erik at mythtv:~/t/branch2 $ bzr pull ../branch1
> comparing histories
> bzr: error: These branches have diverged. Try merge.
>
>
> Regards,
> Erik
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050817/fef84a38/attachment.pgp
More information about the bazaar
mailing list