2

Imagine situation like this: You have a working repo in bitbucket - you were pulling revisions from another bitbucket repo in Windows 7 through TortioseHG.

Now the second project has moved to Github system and you can not pull from it anymore.

So my question is like this: How can i somehow create new repo in bitbucket where I will pulling changes from github and from this repo i can easily pull in Tortiose HG to my working repo?

I do not want to use Github etc, so please do not advice it to me etc just help me with my question. Thank you.

Byakugan
  • 981
  • 4
  • 15
  • 34

1 Answers1

1

The ideal solution consiste to keep local Mercurial repo, and work only with this local repo to the existing bitbucket Mercurial remote repo.

With a plugin like Hg-Git, you can at least push to and pull from a Git server repository from Mercurial, allowing you to pull from the GitHub repo to your local Mercurial repo.

alt text

From that local (Mercurial) repo, you can then work as usual with the bitbucket remote repo.


The OP adds:

It didn't work for me so i tried to transfer git repo to hg repo and from this repo pull to my working repo with changes - but it says that: abort: repository is unrelated - but I merged a lot from it. Any help here?

That makes senses, if both repos have been developed separately, you cannot push/pull 2 (mercurial) repos one into another.
This is confirmed at the bottom of the page "Understanding Mercurial", and detailed in the blog post: "What Mercurial Can't Do: Subtree Repos".

The more practical solution would be to make one extra repository (a "parent one") with your two repos declared in it as nested repository.
It would keep both repos independent, allowing to push back to the GitHub repo from your second mercurial repo.

If you don't have to push back to GitHub, but really want to have one repo in which you merge common files, then you can look in "Merge tip from an unrelated repository with Mercurial", but that is much more complex.

I would rather:

  • keep both repos separate
  • delete from the first one the common files you need to merge in the second one.
  • report and merge those common files in the second one.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • how to install this plugin to windows seven mercurial? – Byakugan Jan 01 '11 at 16:46
  • @Byakugan: you need the python setuptool installed first (http://packages.python.org/distribute/easy_install.html) before trying `easy_install hg-git` (which means also you have python installed first) – VonC Jan 01 '11 at 17:47
  • OK i have installed python and its setuptools so what now exactly to make it work? :-) – Byakugan Jan 01 '11 at 20:49
  • @Byakugan: that means you have access to the command 'easy_install'. From there, I don't have many much details than the ones described in the "Installing" section of http://hg-git.github.com/ – VonC Jan 01 '11 at 21:16
  • I am trying but still when i execute this in command shell in windows it still says no such command or something like that ... – Byakugan Jan 01 '11 at 21:27
  • @Byakugan: right, probably a `PATH` issue, see for instance http://blog.sadphaeton.com/2009/01/20/python-development-windows-part-2-installing-easyinstallcould-be-easier.html – VonC Jan 01 '11 at 21:53
  • oh my god is it really so hard? – Byakugan Jan 01 '11 at 22:13
  • there has to be easier way to do this. – Byakugan Jan 02 '11 at 01:19
  • @Byakugan: no, I believe this is the recommended process when having to deal with those two different DVCS. Granted, a bit of perseverance is needed, but that is what makes this job fun ;) – VonC Jan 02 '11 at 07:43
  • It didnt work for me so i tried to transfer git repo to hg repo and from this repo pull to my working repo with changes - but it says that: abort: repository is unrelated - but I merged a lot from it. Any help here? – Byakugan Jan 02 '11 at 14:05
  • @Byakugan: that is an error which makes sense and seems normal to me. I have expanded my answer to address this new issue. – VonC Jan 02 '11 at 15:14
  • No I copied first and did some changes there and every day i merged around 15 new revisions to my modified repo which was the same one year ago and every day i merged it without any problem. Now after conversion it does not work. – Byakugan Jan 02 '11 at 16:18
  • @Byakugan: I would expect that, after conversion, those two repos wouldn't work well together, since their SHA1 could be different. The "merging changeset" tip might be appropriate then in this case. – VonC Jan 02 '11 at 16:46
  • So I finally get through http://blog.sadphaeton.com/2009/01/20/python-development-windows-part-2-installing-easyinstallcould-be-easier.html this manual and get easy_install working (i have to close and open command window after every step :-( I do not have to in unix - almost after adding part compiler=mingw32 to file and executing "easy_install hg-git" i get this error: http://pastebin.com/C3i1hMJB and i have every compiler installed - i searched the internet and found only linus solution to install dev package od python ... Any ideas? Thx – Byakugan Jan 02 '11 at 21:05
  • I have found some manual and updated some pathc and copy files from system32 and now i have this error: _objects.exp: file not recognized: File format not recognized collect2: ld returned 1 exit status dllwrap: gcc exited with status 1 error: command 'dllwrap' failed with exit status 1 – Byakugan Jan 03 '11 at 14:31
  • @Byakugan: interesting. At this point, it could be interesting to describe precisely your steps in a new question in order to let other contributors to help you. I fear this long thread of comments isn't visible enough for others to assist. – VonC Jan 03 '11 at 15:02
  • Ok here it is :-) http://stackoverflow.com/questions/4585776/installing-hg-git-on-windows-7-64bit – Byakugan Jan 03 '11 at 15:34