开发者

How to add files to a mercurial repository after they were deleted

开发者 https://www.devze.com 2023-02-19 16:48 出处:网络
开发者_C百科I have a mercurial repository. I removed a folder that contained a lot of subfolders and files from it and made a commit.
开发者_C百科

I have a mercurial repository. I removed a folder that contained a lot of subfolders and files from it and made a commit.

Now, when I try to to add a folder that has the same name that also contains huge amount of files and subfolders, mercurial doesn't see these new files.

I tried hg add folder_name, hg add folder_name/ and even hg add folder_name/* but hg status displays nothing after that.

What is wrong?

UPD: I tried to add a new folder with a different name withoud deleting the old one: hg add service/resources/skels/0.92/* but that didn't add files that are in subfolders of 0.92 folder.


The following session with Mercurial 1.7.1 demonstrates that removing and re-adding a folder is normally not a problem:

D:\hg>hg init test
D:\hg>cd test
D:\hg\test>mkdir folder
D:\hg\test>echo foo > folder/foo
D:\hg\test>hg add folder
adding folder\foo
D:\hg\test>hg ci -m "added folder"
D:\hg\test>hg rm folder
removing folder\foo
D:\hg\test>hg ci -m "removed folder"
D:\hg\test>mkdir folder
D:\hg\test>echo foo > folder/foo
D:\hg\test>hg add folder
adding folder\foo
D:\hg\test>hg status
A folder\foo
D:\hg\test>hg ci -m "added folder again"

Can you show such a sequence of commands which reproduces the problem?


I'm guessing you made an error during your original deletion/commit.

Try removing folder_name entirely, then doing a commit and verify it's completely removed from the latest changeset. Then move folder_name back into the repo. You should then be able to hg add folder_name.

0

精彩评论

暂无评论...
验证码 换一张
取 消