Reputation: 62588
I've a _project_
directory (well, it's not named project but never mind that, the underscored are there though) with several subdirectories and a bunch of files. Around of size of 100Mb, give or take is the size of it with the .hg repo inside.
Now, I've had another, let's call _something_
directory with the .hg repo inside, which I've moved completely to _project_
and ran hg status
. Nothing showed up!
Something has files with dates running up 5 years behind, and some of them are older than project repo, but I don't think that should matter.
No .hgignore in any of these, anywhere.
Has anyone got a clue why hg status
wouldn't show these "new" files in its subdirectory? Do the underscores in the name have anything to do with it?
...
"Nested" repos?
\_project_\.hg
\_project_\_something_\.hg
Upvotes: 2
Views: 172
Reputation: 73808
If you nest repositories like you show with:
\_project_\.hg
\_project_\_something_\.hg
then all Mercurial commands will very carefully ignore the nested _something_
repository.
This is done since it would be weird to track a file in _something_
in two repositories. Also, there are many people who version control their home directory so that there is both
/home/mg/.hg/
and
/home/mg/src/foo/.hg/
The inner foo
repository is just a clone of something I work on. Here it's really nice that hg status
wont show files in foo
when I'm in the root of my home directory.
Like zerkms point out, we have a feature called subrepositories that let you work with nested repositories in a special way. I don't think that's what you want here, though.
I take it that you don't want to lose the history for your files in _something_
and that you do want to have _something_
inside _project_
. If so, then you can rename the files inside _something_
to push them one level down and then add the files from _project_
at the top level. Please see this answer for the details.
Upvotes: 2
Reputation: 255115
You got the issue because you nested the repositories manually. It is wrong and isn't supposed to work. You won't see any files added to the nested repository while used hg status
for outer one. Proper nesting will solve the issue.
https://www.mercurial-scm.org/wiki/Subrepository
Upvotes: 5