0

I have a problem when trying to convert.

There is "master" branch and also another branch named "testing"

When I use standard method hg convert gitbranch hgconvertedbranch I get two heads and need merge. - It merge somehow both branches and I get sources and changes different from original "master" branch which only I need to convert.

Do you have any solution for that? Any option for "hg convert" command to make convert really only master branch and not all togerther? Thank you.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Byakugan
  • 981
  • 4
  • 15
  • 34

2 Answers2

1

Just make a local clone of your git repository with only one branch, and convert to hg from that.

jade
  • 744
  • 5
  • 16
  • I tried that of course. Maybe problem with address: There is address https://github.com/XXX/XXX/tree/testing but in master is just: https://github.com/XXX/XXX/ and it made all? Because I clone this and it makes heads so? – Byakugan Jan 06 '11 at 02:14
  • 1
    Try `git branch` to see all your branches, and then delete all of them except master. Like, `git branch -d testing` – jade Jan 06 '11 at 02:35
  • Still problem ... seems it is problem in revision when it says commit message: Merge branch 'master' of github.com:XXX/XXXX into testing - so only one branch is there but this revision is making new heads not all branch as I first thought ... – Byakugan Jan 06 '11 at 02:38
  • When i use "git branch" it says "master" only so how can be there commit "merge master into testing"??? – Byakugan Jan 06 '11 at 02:44
  • "git branch" lists the branches currently in the repository; there's only one branch now. The message in the commit-- "Merge branch ... into testing" is just whatever the committer typed in. However, if that commit is a merge (commit with multiple direct ancestors), maybe "hg convert" can't handle it? (I can help with git, but not hg.) – jade Jan 06 '11 at 03:48
  • So no solution for that maybe? :-( – Byakugan Jan 06 '11 at 11:03
0

After you've done the convert to Mercurial you can use clone -r ONEHEAD converted new to get a repo having only revision ONEHEAD and all its ancestors.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
  • If you meant " hg clone -r convertedrepo newrepo" - it totally messed up repository/branch and needs to merge anyway so This answer is wrong. – Byakugan Jan 06 '11 at 10:58