tags:

views:

48

answers:

2

I have successfully converted my svn repository into mercurial, however when I clone this repo the default branch is given the project name instead of "default".

examples:

on remote server:

hg branch
default

on local machine:

hg clone http://server/hg/coolProject
hg branch
coolProject

I would expect the hg branch on my local machine to output "default". I wouldn't really care about this, but when I push my changes back into the originating repo a new head is created and I assume this is because of the different branch name.

A: 

When you say "the default branch is given the project name default" are there no changesets with the branchname "default" or is that just what branch you ended up on after cloning? If it's the later you can always just hg update default.

If it's the former you could re-convert using the --branchmap option to rename the branch you're getting to default.

Ry4an
Here is what I did.1. On server: I converted my svn repo into a mercurial one using hg convert. This repo is called "coolProject".2. On local pc: I cloned the new mercurial repository to my local machine using hg clone.Now when I look at the branches on my server's repo, it has one branch that is labeled "default". However, when I look at my local repo it has one branch that is labeled "coolProject".I expected a clone to be an exact copy. So why the different name of the initial branch? I'm not blaming mercurial; I'm sure I'm screwing something up, but I just don't known what it is.
Cliff
I'm going to guess the one on your server is also named 'coolProject' and that something (hgweb?) is showing it as default. In mercurial the branch name of a a changeset is part of its hash and is completely unchangeable, so it's definitely not the case that the branch is getting renamed on clone. What does 'hg branches' show when run from the command line on the server repo?
Ry4an
A: 

The hg branch command shows you the branch that you are currently on. Use the hg branches command instead. Probably the remote server and local machine are not on the same revision.

Use a repository explorer, hg serve, or hg identify and hg log to see if this is the case.

As for the project name ending up as a branch name, as in SVN branches are really just folders and branching is done by convention, probably the SVN conversion mistook the project folder for a branch folder. Does your SVN project have the standard folder layout of trunk/branches/tags? In that case, specify your layout using the convert.svn options (see hg help convert). You could also try to go one directory up or down or something.

Laurens Holst
I've tried the hg branches method. On my server I see a branch labeled as "default", while on my local pc I see a branch labeled "coolProject".
Cliff
did you try to `hg update tip` in both repositories? And if you do `hg identify` and `hg tip`, do you get the same revisions?
Laurens Holst