Hi,

Up to now vim-cocoa [1] uses vim svn repo from sf.net [2] and git-svn
to mirror the upstream updates. Since Bram officially announced that
he will switch to hg for all future vim developments [3] and CVS will
be abandoned, the svn repo, which is synced from CVS, will soon become
deprecated. That's why I need to switch the upstream repo of vim-cocoa
from svn to hg.

Here are the steps I found to be quite reliable:

First of all, we need a separated, local vim hg repo:

  $ hg clone https://vim.googlecode.com/hg/ vim-hg

Second, we need a tool called hg-fast-export:

  $ git clone git://repo.or.cz/fast-export.git

Then, we can create a new git repo from scratch and import the hg repo
we previously cloned:

  $ mkdir vim
  $ git init
  $ ../fast-export/hg-fast-export.sh -r ../vim-hg
  $ git repack -adf  # repack to optimize for disk usage

The hg-fast-export.sh process will take a while, it can be run
multiple times to do incremental import.

After that, I go back to my original git repo (branched from git-svn),
format everything diverged from upstream into patches:

  $ cd ../vim-cocoa
  $ git format-patch ...
  (A bunch of .patch files will be created)

Now we can import these patches into our new git repo:

  $ cd ../vim
  $ git checkout -b cocoa
  $ cat ../vim-cocoa/*.patch | git am -3

The "-3" option is for automatic 3-way merging, in case there may be
some patches do not apply.

OK, now we get a new upstream from hg and all our commit history back
(assuming our old git repo is properly rebased). If upstream is
updated later, we can use the following commands to keep our
repo/branch in sync:

  $ cd ../vim-hg; hg pull; cd -
  $ ../fast-export/hg-fast-export.sh -r ../vim-hg
  $ git rebase master

I guess MacVim may also need this, hope it helps.

- Jiang

[1] http://code.google.com/p/vim-cocoa
[2] https://vim.svn.sourceforge.net/svnroot/vim/vim7
[3] 
https://groups.google.com/group/vim_dev/browse_thread/thread/a6507cfd8470f19e

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe, reply using "remove me" as the subject.

Reply via email to