hg rename 不会删除工作副本中的原始文件夹
我在 Mercurial 存储库中有一个名为 httpdocs/css/ui-lightness 的目录。我想将此目录及其所有内容移至 httpdocs/css/jquery/themes/ui-lightness。所以,我认为这是启动命令:
hg rename httpdocs/css/ui-lightness httpdocs/css/jquery/themes/ui-lightness
事实上,我已经尝试过并且它似乎可以工作,除了在工作副本中“源”目录(即 httpdocs/css/ui-lightness)不是已删除(在存储库中时)。
有人可以解释为什么吗?
I've a directory in Mercurial repository called httpdocs/css/ui-lightness. I want to move this directory and all its contents to httpdocs/css/jquery/themes/ui-lightness. So, I think this is the command to launch:
hg rename httpdocs/css/ui-lightness httpdocs/css/jquery/themes/ui-lightness
In fact, I've already tried and it seems to work, except that in the working copy the "source" directory (that is, httpdocs/css/ui-lightness) is NOT deleted (while in the repository it is).
Can someone explain why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Krtek 发现,您所做的应该有效。这是我在本地运行的情况:
如果
httpdocs/css/ui-lightness
中有任何未跟踪(可能被忽略)的文件,它们将不会被重命名,因此该目录不会为空,因此不会被删除,但应该移动该目录中的跟踪内容。请注意,我还没有提交该重命名(即使 Mercurial 知道它是重命名,它也会显示为“添加”和“删除”),但为了使其反映在其他克隆中,我需要 hg commit 、
hg Push
,他们必须hg pull
,然后hg update
或hg merge
>。A Krtek found, what you're doing should work. Here's me running it locally:
If you have any untracked (possibly ignored) files in
httpdocs/css/ui-lightness
they won't be renamed and thus the directory won't be empty and thus not removed, but the tracked contents in that directory should be moved.Notice I've not yet committed that rename (and that it shows up as an Add and a Remove even though Mercurial knows it's a rename), but for it to be reflected in other clones, I'd need to
hg commit
,hg push
and they'd have tohg pull
and then eitherhg update
orhg merge
.您如何称呼“存储库”和“工作副本”?您在哪里执行
hg rename
命令?我认为您只是忘记将更改推送到一侧,然后在另一侧进行拉动。更改不会神奇地出现在存储库的所有克隆中,您必须检索更改。
我刚刚测试过,
hg rename
可以很好地删除文件。What are you calling the "repository" and the "working copy" and where do you do your
hg rename
command ?I think you just forgot to push your changes on one side and then do a pull on the other side. Changes won't magically appear in all the clones of your repository, you must retrieve the changes.
I just tested,
hg rename
removes the files just fine.它不会删除源,只是将其标记为在存储库中删除。之后您应该手动删除文件。
It does not delete the source, it just marks it for removal in the repository. You should remove files by hands afterwards.