[PATCH 0 of 6] Recursive status and diff for subrepositories

Martin Geisler mg at lazybytes.net
Mon Aug 30 17:01:32 CDT 2010


Hi everybody,

These patches add a -S/--subrepos option to the status and diff
commands which will make then recurse into subrepositories.

Please give them a try and take a look at the code. The basic idea is
to iterate over the subrepos in commands/localrepo/... and call a
method on each of them. For the hgsubrepo class, the method will most
likely call back to commands/localrepo/... in a recursive fashion.

There is a single match object on the top-level and this contains all
paths given on the command line, including those that point into
subrepos. Each recursive calls will narrow the match object via a
match.subrepomatcher object and so only operate on the files that
really lie in the current subrepository. I think this approach is
pretty clean and it seems to work well in these two cases.

I looked briefly at the cat and add commands today, but they use
another approach based on context.walk and I'm unsure how to adapt
this to the recursive style from above. Any hints will be gladly
accepted :)


More information about the Mercurial-devel mailing list