A stupid problem with a nested repo

Yuya Nishihara yuya at tcha.org
Sun Jan 27 22:44:18 UTC 2019


On Sun, 27 Jan 2019 22:12:44 +0700, Victor Sudakov wrote:
> Yuya Nishihara wrote:
> > On Sun, 27 Jan 2019 21:00:02 +0700, Victor Sudakov wrote:
> > > Victor Sudakov wrote:
> > > > Steve - Gadget Barnes wrote:
> > > > > Is it possible that the "modified" files have been added to the parent repo rather than namedb? 
> > > > 
> > > > In this case, "hg status' in the child "namedb" repo would show them
> > > > with "?" markers, but this is not happening.
> > > > 
> > > > In fact, they may be erroneously added to both repos, but how do I fix
> > > > this?
> > > 
> > > No, this does not seem to be the case:
> > > 
> > > $ hg status
> > > $ hg status -S 
> > > M namedb/master/biometrica.tomsk.ru
> > > M namedb/master/rusnet.tomsk.ru
> > > M namedb/master/tomsk.su
> > > $ hg log namedb/master/rusnet.tomsk.ru
> > > abort: path 'namedb/master/rusnet.tomsk.ru' is inside nested repo 'namedb'
> > > $ 
> > > 
> > > 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.

In general, you need to commit the main repo after committing changes to its
subrepository.



More information about the Mercurial mailing list