Convert bzr

Giorgos Keramidas gkeramidas at gmail.com
Sun Dec 16 21:39:07 UTC 2012


On Sun, 16 Dec 2012 12:52:54 -0800, Adrian Klaver <adrian.klaver at gmail.com> wrote:
>On 12/16/2012 12:45 PM, Patrick Mézard wrote:
>>> This might be a good time to ask what is supposed to happen?
>>> I am working under the assumption that using convert creates a new
>>> directory with a .hg subdirectory and the working files from the
>>> original repo(this case bzr) copied over. Is this what is intended or
>>> am I making a false assumption?
>>
>> It creates a new repository but does not checkout anything. Here you
>> may have an issue with a simple "hg update" because convert created a
>> misplaced tag changeset (meaning you have two heads on default
>> branch). Running:
>>
>>    $ hg branches
>
> Yes, this seems to be the problem.
>
> aklaver at panda:~/aws-hg> hg branches
> default                       33:1e9350baa645
> aws                           32:862c477a9ad0
>
> I started with this repo because it was small and simple:) After my
> last email I decided to run convert against some larger repos and it
> worked. I was in the process of trying to figure out wht when your
> email landed. Thanks.

Aha! It seems that hg convert added a tag update commit on the 'default'
branch, right after it converted everything else to be on the 'aws'
branch from the original repository — exactly like Patrick said.

It should be visible in a history-graph viewer.  You can temporarily
enable the 'graphlog' extension and look at the output of the following
command:

    hg --config '[extensions].graphlog=' log --graph | more

This should show two disconnected parts in the history graph.  One with
all your changesets in the 'aws' branch, and one with just the .hgtags
update that the conversion submitted in the 'default' branch.  Look at
the two changes you just pasted above: 862c477a9ad0 and 1e9350baa645.
Their separate branch should be clearly visible ;-)

You can fix this for now by cloning the 'aws' branch only of the
converted repository, and rerunning the conversion script with the
convert.hg.tagsbranch option, to make sure tag updates happen in the
'aws' branch by default:

    hg clone -b aws aws-hg aws-hg-fixed
    hg convert --config convert.hg.tagsbranch='aws'    \
        SOURCE-BZR-REPOSITORY                          \
        aws-hg-fixed

Now the 'aws-hg-fixed' repository should have the tags in the 'aws'
branch, and only one branch.

This should be enough if you are only ever going to have the 'aws'
branch.  Otherwise, you can keep the tag updates in the 'default'
branch, and just check out the 'aws' branch for your own work with:

    hg update --clean aws

I hope that helps a bit to understand what happened, and what you do
now,

Giorgos

-- 
Giorgos Keramidas; gkeramidas at gmail.com



More information about the Mercurial mailing list