# HG changeset patch # User Steve Losh # Date 1307464912 14400 # Node ID fe78a06f87a448567261f78adbaacc0e0339ca92 # Parent d173e6dcfe6c0a8bd6653281d3f2fbe0b90eed69 Docs. diff -r d173e6dcfe6c -r fe78a06f87a4 .hgrc --- a/.hgrc Tue Jun 07 12:37:33 2011 -0400 +++ b/.hgrc Tue Jun 07 12:41:52 2011 -0400 @@ -211,4 +211,20 @@ # Update subrepos subpull = !grep = "`$HG root`/.hgsub" | cut -d' ' -f1 | xargs -n 1 -I SUB hg pull --cwd "`$HG root`/SUB" subup = !grep = "`$HG root`/.hgsub" | cut -d' ' -f1 | xargs -n 1 -I SUB hg update --cwd "`$HG root`/SUB" + +# Run a command on a subrepo: +# +# hg sub SUBREPO_REGEX ...command and arguments... +# +# The SUBREPO_REGEX should be a regex that will let grep match one and only one of +# the subrepos in .hgsub. For example: +# +# $ cat .hgsub +# bundled/foo = ... +# bundled/bar = ... +# +# $ hg sub fo root +# .../bundled/foo +# $ hg sub ar status -m +# M lol.py sub = !grep = "`$HG root`/.hgsub" | cut -d' ' -f1 | grep "$1" | tr -d '\n ' | xargs -0 -I SUB $HG -R SUB $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20