CodeNinja-源碼管理,從SVN遷移至Mercurial.From Subversion to Mercurial

來源:互聯網
上載者:User
From Subversion to Mercurial源碼管理,從SVN遷移至Mercurial

今天成功將一個svn管理的項目遷移到mercurial!得益於以下文章,特摘錄如下:

 

原文地址:http://test.skeed.it/index.php?q=svn-to-hg.html

 

We have just migrated our repository on Google Code from Subversion to Mercurial, preserving the whole project history.

The migration itself was simple and straightforward. The hard part was figuring it out how to perform the migration using a Windows client, because Google's directions omit to specify where to find an essential library, the svn-python bindings. This short tutorial explains how to do the migration in an alternative way.

All that you need is:

  • a recent installation of TortoiseHg (python-svn is bundled with TortoiseHg, thus you don't need to install the library);
  • the hgsubversion extension (instead of convert).

Basically, all we need to do is enabling the hgsubversion extension in TortoiseHg; clone the subversion repository (as if it were a mercurial repository); and push the cloned repository into the brand new mercurial repository.

In more details, this is the step-by-step recipe:

  1. Make sure you have a recent version of TortoiseHg installed.
  2. Download hgsubversion.
    I created a temporary directory on my desktop, cloned the repository http://bitbucket.org/durin42/hgsubversion on that directory using TortoiseHg; and then moved the subdirectory named hgsubversion into TortoiseHg's dir, i.e. C:\Program files\TortoiseHG.
  3. Enable the hgsubversion extension in TortoiseHg.
    First, you have to figure out where TortoiseHg stores its settings. It is in a file named mercurial.ini, which can be located either in the TortoiseHg dir or in the user home dir (i.e.. C:\Users\MyName or C:\Documents and Settings\MyName). Edit mercurial.ini, find the [extensions] section (or create one), and add this line: hgsubversion = C:\path\to\hgsubversion (e.g. hgsubversion = C:\Program Files\TortoiseHg\hgsubversion).
  4. Clone your subversion repository using TortoiseHg.
    Create a directory, and clone http://yourproject.googlecode.com/svn/. If everething worked well, TortoiseHg will not complain that the repository isn't a mercurial one, and will clone it (it will take some time).
  5. Switch to Mercurial in your project administration tab, in Google Code.
  6. Push your local repository into your brand new mercurial repository on Google code.
    Use TortoiseHg's Hg Repository Explorer; type https://yourproject.googlecode.com/hg/ in the address bar, and select the Synchronize -> Push command. Remember that, like in subversion, your password is the "temporary" one assigned by Google. You can find it by clicking on Profile and selecting the Settings tab.

...that's all folks, happy hg-ing!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.