[core-workflow] Help needed: best way to convert hg repos to git?

Oleg Broytman phd at phdru.name
Sat Feb 6 10:50:51 EST 2016


Hello!

On Sat, Feb 06, 2016 at 01:57:15AM +0000, Brett Cannon <brett at python.org> wrote:
> https://www.python.org/dev/peps/pep-0512/#define-commands-to-move-a-mercurial-repository-to-git
> 
> There appear to be multiple ways to convert hg repos to git, but no clear
> winner. It would be great if some one/people took on the task of evaluating
> the tools available out there by converting the cpython repo and seeing
> which one has the best results.

   Let's me try git-remote-hg transport.

$ hg clone https://hg.python.org/cpython/ cpython-hg

$ time git clone hg::cpython-hg cpython-git
real  39m44.600s
user  45m54.192s
sys   1m4.184s

$ cd cpython-git/
* master                          6bd585f merge from 3.5
  remotes/origin/HEAD             -> origin/master
  remotes/origin/branches/2.7     9842886 Fix userinfo example presented in urllib2 howto.
  remotes/origin/branches/3.2     51e4a9f Issue #25940: On Windows, connecting to port 444 returns ETIMEDOUT
  remotes/origin/branches/3.3     a017765 Issue #25940: Merge ETIMEDOUT fix from 3.2 into 3.3
  remotes/origin/branches/3.4     1b9c53a reject negative data_size
  remotes/origin/branches/3.5     411a8a5 Fix userinfo example presented in urllib2 howto.
  remotes/origin/branches/default 6bd585f merge from 3.5
  remotes/origin/master           6bd585f merge from 3.5

$ git log --decorate --graph -5
*   commit 6bd585f (HEAD, origin/master, origin/branches/default, origin/HEAD, refs/hg/origin/branches/default, refs/hg/origin/bookmarks/master, master)
|\  Merge: 10cbbbf 411a8a5
| | Author: Senthil Kumaran <senthil at uthcode.com>
| | Date:   Fri Feb 5 19:37:47 2016 -0800
| | 
| |     merge from 3.5
| |   
| * commit 411a8a5 (origin/branches/3.5, refs/hg/origin/branches/3.5)
| | Author: Senthil Kumaran <senthil at uthcode.com>
| | Date:   Fri Feb 5 19:37:23 2016 -0800
| | 
| |     Fix userinfo example presented in urllib2 howto.
| |   
* | commit 10cbbbf
| | Author: Yury Selivanov <yselivanov at sprymix.com>
| | Date:   Fri Feb 5 19:40:01 2016 -0500
| | 
| |     Issue #26288: Optimize PyLong_AsDouble.
| |   
* | commit e5185e7
| | Author: Eric V. Smith <eric at trueblade.com>
| | Date:   Fri Feb 5 18:26:20 2016 -0500
| | 
| |     Switch to more idiomatic C code.
| |   
* | commit b59cb8f
| | Author: Eric V. Smith <eric at trueblade.com>
| | Date:   Fri Feb 5 18:23:08 2016 -0500

PS. git-remote-hg provides bidirectional transport. You can continue
pulling from Mercurial repository(ies) and you can commit and push back
to Mercurial repository(ies).

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.


More information about the core-workflow mailing list