如何在删除文件后将文件添加到 Mercurial 存储库

发布于 2024-10-26 21:03:20 字数 427 浏览 2 评论 0原文

我有一个水银存储库。我从中删除了一个包含许多子文件夹和文件的文件夹并进行了提交。

现在,当我尝试添加一个具有相同名称且还包含大量文件和子文件夹的文件夹时,mercurial 看不到这些新文件。

我尝试了 hg addfolder_namehg addfolder_name/ 甚至 hg addfolder_name/*hg status 没有显示任何内容在那之后。

怎么了?

UPD:我尝试添加一个具有不同名称的新文件夹而不删除旧文件夹:hg add service/resources/skels/0.92/*但这没有添加0.92 文件夹的子文件夹中的文件。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷…雨湿花 2024-11-02 21:03:20

以下使用 Mercurial 1.7.1 的会话演示了删除并重新添加文件夹通常不是问题:

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"

您能显示重现该问题的命令序列吗?

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 2024-11-02 21:03:20

我猜您在最初的删除/提交过程中犯了错误。

尝试完全删除 folder_name,然后进行提交并验证它是否已从最新变更集中完全删除。然后将 folder_name 移回到存储库中。然后您应该能够hg addfolder_name

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文