ANN: deps extension

Martin Vejnár avakar at ratatanek.cz
Tue Apr 7 15:09:38 CDT 2009


Hi,

I've recently cloned the deps extension, originally developed by Aleix
Conchillo Flaque, and have made some improvements. I'd love to hear your 
comments.

   http://ratatanek.cz/hg/hgdeps

It should work with version 1.0 and above (tested on 1.0 and 1.2.1).

The extension allows you to comfortably work with external dependencies.
The dependency lists are versioned and can be quickly applied with 'hg
depupdate' command.

The easiest way to start is to define the dependencies you'll be using.

$ hg depalias gui http://ratatanek.cz/hg/gui

A file named .hgdeps will appear in your working dir. Don't forget to
commit! Use 'hg dep' to move and update dependencies.

$ hg dep gui lib/gui v0.1

You can always check the state of your dependencies with 'hg -v 
depstatus'. After you make sure your project works correctly with the 
new dependency or the new version of an old dependency, commit your 
changes and then run 'hg depcommit', which will record your changes into 
.hgdeps file and automatically commit them. Think of this command the 
same way you think about 'hg tag'. You can safely run 'hg depcommit' 
after each 'hg commit', the dependency list will only be recorded if 
some changes were made.

$ hg depcommit
$ hg log
changeset:   6:7be195f652bf
tag:         tip
user:        Martin Vejnar <avakar at ratatanek.cz>
date:        Tue Apr 07 14:19:29 2009 +0200
summary:     Updated dependency list for changeset 7220338eb0ac

changeset:   5:7220338eb0ac
user:        Martin Vejnar <avakar at ratatanek.cz>
date:        Sat Apr 04 16:44:40 2009 +0200
summary:     Updated gui to v0.2 and fixed dependent code.

You can also use the extension to work with svn dependencies. Read 'hg 
help hgdeps' for more info.

I'm planning on wrapping 'hg up', 'hg st' and 'hg ci' to automatically 
run 'hg depup', 'hg depst' and 'hg depci', respectively. This way, the 
management of dependencies would be completely transparent.

Hope you like it,
-- 
Martin


More information about the Mercurial mailing list