Mercurial:重命名文件会导致存储库中的内容重复? [英] Mercurial: Renaming a file results in duplicate contents in repository?

查看:97
本文介绍了Mercurial:重命名文件会导致存储库中的内容重复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天才刚开始使用Mercurial(我没有太多的编程经验).我注意到,如果重命名200MB的文件,理想情况下,存储库的大小不应更改,但发现它增加了200MB.

I just start using Mercurial yesterday (I don't have much programming experiences). I noticed, if I rename a 200MB file, ideally the repository size should not change, but I found it increased 200MB.

这是Mercurial的错误/弱点吗?将来有可能对其进行修复/改进吗?

Is this a bug/weakness of Mercurial? Any chance it could be fixed/improved in future?

更新:

我刚刚在Windows 7 64bit上尝试过TortoiseGit 64bit版本.重命名文件时,它不会创建重复的内容.但是似乎一旦我重命名文件,它的历史记录就会丢失.

I have just tried TortoiseGit 64bit version on Windows 7 64bit. It didn't create duplicate contents when renaming files. But it seems once I renamed a file, its history was lost.

更新2:

请参阅下面的 tonfa 的评论.来自Mercurial Wiki- GSoC Ideas 2010 :

See tonfa's comment below. From Mercurial wiki - GSoC Ideas 2010:

项目构想

轻量级副本/重命名

(非常困难-成功的学生 将成为水星的专家 存储格式和传输 协议)

Project Ideas

Lightweight copies/renames

(very difficult - a successful student will become an expert in Mercurial's storage format and transmission protocol)

当前不是副本和重命名 太有效率了.水星复制 复制/重命名源文件到新 目标文件的初始修订版本 其内部历史记录存储区.为了 重命名,尤其是 违反直觉,因为重命名 文件使文件的存储量增加 尺寸.如果水星会更好 有某种方式来指代 新文件中的现有修订, 同时保持向后 兼容性和有限的I/O 检索修订的保证. 参见 issue883 进行讨论. 以前的尝试有一个mq 这位于此处.

Copies and renames currently are not too efficient. Mercurial copies the copied/renamed source file to the new initial revision of the target file in its internal history store. For renames, this is especially counter-intuitive, as renaming a large file grows the store by the file's size. It would be better if Mercurial had some way of referring to the existing revision from the new file, while preserving backwards compatbility and bounded I/O guarantees for retrieving revisions. See issue883 for discussion. There's an mq from an old attempt at this located here.

联系方式:mpm,tonfa,氰酸盐

Contact: mpm, tonfa, cyanite

推荐答案

不,这不是bug.重命名会导致在旧位置删除文件并在新位置创建文件(但保留引用,以用于合并和记录).

No, it is not a bug. Renaming in mercurial causes removing file in old place and creating it in new one (with keeping the reference though, for merge and logging purposes).

所以至少到目前为止,您什么也不能做.

So at least for now you can do nothing.

这篇关于Mercurial:重命名文件会导致存储库中的内容重复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆