Maintain a patched Vim development tree
The goal is to maintain a Vim Mercurial repository synchronized with the latest Vim development tree, and a Mercurial Queues patch synchronized with pyclewn vim-patches. Whenever you want to update from the Vim development tree:
- the patches are first popped out
- changes are pulled into your Vim repository
- changes are pulled into pyclewn vim-patches
- the patches are pushed back
Initial setup
The following assumes that Vim latest patch is vim-7.2.ddd, and that vim-7.2.nnn is the closest pyclewn vim-patches tag smaller or equal to vim-7.2.ddd.
Clone Vim development tree and clone a working copy:
$ hg clone --noupdate http://vim.googlecode.com/hg/ vim-master $ hg clone vim-master vim-working
Enable Mercurial Queues extension by editing your ~/.hgrc and adding:
[extensions] hgext.mq =
Edit vim-working/.hg/hgrc and add the following hooks:
[hooks] # Prevent "hg pull" if MQ patches are applied. prechangegroup.mq-no-pull = ! hg qtop > /dev/null 2>&1 # Prevent "hg push" if MQ patches are applied. preoutgoing.mq-no-push = ! hg qtop > /dev/null 2>&1
Get pyclewn vim-patches:
$ cd vim-working $ hg clone http://pyclewn.hg.sourceforge.net/hgweb/pyclewn/vim-patches .hg/patches
Browse Vim logs to get the latest Vim patch number vim-7.2.ddd, and run the mq tags command to list the vim-patches tags and to find vim-7.2.nnn which is the closest pyclewn vim-patches tag smaller or equal to vim-7.2.ddd:
$ hg log $ alias mq='hg -R $(hg root)/.hg/patches' $ mq tags
Update vim-patches to vim-7.2.nnn, and push all patches:
$ mq update --rev vim-7.2.nnn $ hg qpush --all
Build Vim.
Update Vim tree
The following assumes that Vim latest patch is vim-7.2.ddd, and that vim-7.2.nnn is the closest pyclewn vim-patches tag smaller or equal to vim-7.2.ddd.
Pop all the patches:
$ cd vim-working $ hg qpop --all $ cd ..
Pull Vim changes into vim-working:
$ cd vim-master $ hg pull $ cd ../vim-working $ hg pull --update
Pull vim-patches changes:
$ alias mq='hg -R $(hg root)/.hg/patches' $ mq pull
Browse Vim logs to get the latest Vim patch number vim-7.2.ddd, and run the mq tags command to list the vim-patches tags and to find vim-7.2.nnn which is the closest pyclewn vim-patches tag smaller or equal to vim-7.2.ddd:
$ hg log $ alias mq='hg -R $(hg root)/.hg/patches' $ mq tags
Update vim-patches to vim-7.2.nnn, and push all patches:
$ mq update --rev vim-7.2.nnn $ hg qpush --all
Build Vim.