在mercurial中,如何处理两个版本中的同名文件和目录?
这个问题可以简单地说明:
hg init temp
cd temp
touch a
hg ci -A -m file
hg rm a
mkdir a
hg ci -m dir
hg up -r0
最后一个命令失败,并显示 abort: Is a directory: a
(或者在 Windows 上更神秘的访问被拒绝
)。
有什么解决方法吗?
我在转换遗留代码库时遇到了这个问题。我确实需要完全自动化转换,因为我有数十个版本的庞大代码库需要处理,并且同义文件/目录可能随时发生。
The problem can be trivially illustrated:
hg init temp
cd temp
touch a
hg ci -A -m file
hg rm a
mkdir a
hg ci -m dir
hg up -r0
The last command fails with abort: Is a directory: a
(or a more cryptic Access is denied
on Windows).
Is there any workaround?
I ran into this exact problem when converting legacy code base. I really need to fully automate the conversion since I have dozens of versions of a huge code base to deal with, and synonymous file/dir can happen at any time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
补充:
上次更新前,去掉空目录。请注意,即使您添加了目录,它仍然不会被跟踪; Mercurial 不跟踪空目录(它仅隐式跟踪非空目录)。
purge
删除“未知文件”和“空目录”。Add:
before the last update, to get rid of the empty directory. Note that even if you had added the directory, it would still not be tracked; Mercurial does not track empty directories (it only tracks non-empty ones implicitly).
purge
removes "Unknown files" and "Empty directories".