A stupid problem with a nested repo
Victor Sudakov
vas at mpeks.tomsk.su
Mon Jan 28 01:57:30 UTC 2019
Yuya Nishihara wrote:
[dd]
> > > > Anyway, "hg commit" in the parent repo committed the .hgsubstate file,
> > > > and the problem seems gone for now.
> > > >
> > > > Is this normal? Am I expected to commit the .hgsubstate file?
> > >
> > > Yes, that's correct.
> > >
> > > Until you committed the .hgsubstate, the main repo was tied to some older
> > > revision of the "namedb" repo.
> >
> > If that is the case, why didn't "hg status" in the parent repo show .hgsubstate
> > as "Modified"?
>
> It's somewhat special. The .hgsubstate file isn't "modified" until commit.
> The main repository is say dirty because subrepository contents don't match
> with the tracked state.
>
> > > That's why "hg status -S" in the main repo showed modifications from that revision.
> >
> > This is not my first nested repo, I don't ever remember that .hgsubstate
> > needed any special treatment. Is it documented?
>
> "hg help subrepo" will provide some notion about .hgsubstate file. I don't
> know if it's well documented.
Well, it says
" updating subrepos is a manual process. Simply check out target
subrepo at the desired revision, test in the top-level repo, then commit
in the parent repository to record the new combination. "
Thanks for showing me the right direction.
>
> In general, you need to commit the main repo after committing changes to its
> subrepository.
I've mostly used "commit -S" so far, that is probably why I've never run
into this problem before. So, live and learn.
--
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
2:5005/49 at fidonet http://vas.tomsk.ru/
More information about the Mercurial
mailing list