I have a Mercurial main-repository with one sub-repository, like this:
Main
.hg
.hgsub
.hgsubstate
<some_regular_files_and_subdirs>
Sub
.hg
<some_regular_files_and_subdirs>
And I wish to tag Sub
, only, while keeping Main/.hgsubstate
up-to-date (i.e. point to the changeset of Sub
resulting from the tagging process).
I don't want to tag the main-repository.
Is that possible without tagging from within Sub
and do some magic to get Main/.hgsubstate
up to date?
When updating a subrepo, you always need to perform a commit on the main repo to begin using that subrepo revision. Therefore, you can't exactly do what you want from the subrepo itself, you will have to enter the main repo and execute a single command there.
from the command line:
After you have created the subrepo tag and updated the subrepo to that tag, performing a commit from the top level (ie:
Main
) should update.hgsubstate
and does not require you to tag theMain
repo. In fact, changing the revision of any subrepo should trigger a change in the .hgsubstate file, which can be committed in the main repo without a tag.