I have a mercurial repository (main repo) with several sub repositories.
I need a mercurial command to show if the revision of a sub repo changed (including information on old and new revision) in the working copy or if the sub repo state is dirty.
How can I do this?
Most mercurial commands accept the
-S
or--subrepos
flag. Thus by callinghg st -S
you get a list of all changed files which include those in the sub-repos, if their state differs from the state recorded in the .hgsubstate file:As to your wish to obtain the actual revisions, that's AFAIK not possible with one command. However you can always check the status of the individual sub-repos like above or can check them from the main repo by giving mercurial another path to operate on:
In order to get the status of each repo compared to what is required by the parent repo, I'd resort to some simple bash:
which gives output like
In a similar fashion you can also check whether the state is modified by using
hg st
instead ofhg id
.