Problem with Mercurial and Branches
Christian Krebs
chrisk at opera.com
Wed Jan 14 21:00:10 UTC 2009
On Wed, 14 Jan 2009 20:53:11 +0100, Paul Franz <theandromedan at gmail.com>
wrote:
>
>
> Christian Krebs wrote:
>> On Tue, 13 Jan 2009 23:50:33 +0100, Paul Franz
>> <theandromedan at gmail.com> wrote:
>>
>>> Christian,
>>> Could you try to re-create the script using the echo command to
>>> modify the files so that we can more easily duplicate where the
>>> problem lies.
>>
>> # Create the source repo with the branches b1 and b2
>> hg init source
>> cd source
>> echo 1 > file-1.txt
>> echo 2 > file-2.txt
>> hg add
>> hg ci -m "added files"
>> hg branch b1
>> hg ci -m "created branch b1"
>> hg branch b2
>> hg ci -m "created branch b2"
>> cd ..
>>
>> # Clone to copy
>> hg clone source copy
>>
>> # Edit file 1 in source, branch b1, and merge b1 into b2
>> cd source
>> hg up b1
>> hg status
>> echo 1.1.src > file-1.txt
>> hg ci -m "edited file 1 in source in b1"
>> hg up b2
>> hg merge b1
>> hg ci -m "merged b1 to b2 in source"
>>
>> # Edit file 2 in copy, branch b1, and merge b1 into b2.
>> cd ../copy
>> hg up b1
>> echo 2.1.copy > file-2.txt
>> hg status
>> hg ci -m "edited file 2 in copy in b1"
>> hg up b2
>> hg merge b1
>> hg ci -m "merged b1 to b2 in copy"
>>
>> # Pull the changes from source and merge the heads (in b2)
>> hg pull
>> hg heads
>> hg merge
>> hg ci -m "merged the two heads in copy"
>>
>> # Check the files
>> echo "> check file 1 on b2, expected '1.1.src'"
>> cat file-1.txt
>> echo "> check file 2 on b2, expected '2.1.copy'"
>> cat file-2.txt
>> hg up b1
>> echo "> check file 1 on b1, expected '1.1.src'"
>> cat file-1.txt
>> echo "> check file 2 on b1, expected '2.1.copy'"
>> cat file-2.txt
>
> If I then do the following the two heads of branch b1 are merged:
>
> hg merge
> hg commit -m "Merge the two branch heads"
>
> and the above checks are good.
Yes, this is true. Interesting. Is this a reliable way to work with named
branches?
(Now we have splitted the repository, but basically i would prefer named
branches.)
>
>>
>>> Because it is possible that you have found a bug.
>>>
>>> Paul Franz
>>>
>>> Arne Babenhauserheide wrote:
>>>> Am Dienstag 13 Januar 2009 22:53:42 schrieb Paul Franz:
>>>>
>>>>> The above makes me believe that what Arne's script does not match
>>>>> yours.
>>>>>
>>>>
>>>> This is possible - I created it from the command log and I may have
>>>> made mistakes. But you can easily test it. Just do a simple $ hg up
>>>> tip
>>>>
>>>> And check the file contents. Best wishes, Arne
>>>>
>>
>>
More information about the Mercurial
mailing list