简体   繁体   中英

hg status ignoring a new moved in directory

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM