Scratch that.

I’ve been collaborating with someone on a new and better way to works with subrepos in Mercurial. We wrote a Mercurial extension that adds commands for directly working on subrepos. It is much more capable than my original script.

You can find the Mercurial extension here: http://bitbucket.org/kirbysayshi/hgsubrepo

You install it like any other Mercurial extension, just place the file somewhere and register the extension in your settings file. You can find details about that process here.

Once installed, you can get help on using it by executing “hg help subrepo”.

 

 

I’ve recently switched to Mercurial for source control. It’s a good system but it’s a little rough around the edges sometimes. One area is subepo support. It’s quite usable but there’s one thing missing that really bugs me: recursive status when using nested repos (i.e. combined status for all subrepos). Right now Mercurial’s status command knows nothing about nested repos. It’s a pain since Mercurial’s commit command will commit all nested repos and without proper status support you can’t tell what will be committed.

However, it’s pretty simple to automate getting this status with a little batch file:

@echo off
for /d /r %%d in (*.hg) do (
    pushd %%d
    cd ..
    cd
    hg status %*
    popd
)

This is a very basic version but it works for getting basic status for both the current and all nested repos. It searches for all repos and executes a hg status in each working directory, passing any arguments that you specify to hg status .

I’m sure someone could also patch this directly into Mercurial, perhaps via an extension but this is simple and it works. Hopefully this is something that won’t be needed for too much longer.

 


Flux and Mutability

The mutable notebook of David Jade