gpt4 book ai didi

Mercurial:轻量级副本/重命名

转载 作者:行者123 更新时间:2023-12-02 08:54:35 24 4
gpt4 key购买 nike

来自 Mercurial wiki - GSoC Ideas 2010 :

Project Ideas

Lightweight copies/renames

(very difficult - a successful studentwill become an expert in Mercurial'sstorage format and transmissionprotocol)

Copies and renames currently are nottoo efficient. Mercurial copies thecopied/renamed source file to the newinitial revision of the target file inits internal history store. Forrenames, this is especiallycounter-intuitive, as renaming a largefile grows the store by the file'ssize. It would be better if Mercurialhad some way of referring to theexisting revision from the new file,while preserving backwardscompatbility and bounded I/Oguarantees for retrieving revisions.See issue883 for discussion.There's an mq from an old attempt atthis located here.

抱歉,如果这是一个明显的问题(我不擅长英语和编程)。我想知道“轻量级副本”是什么意思?

这是否意味着:实现此功能后,多个具有相同内容(相同哈希值不同文件名)的文件将在存储库中仅存储一次(就像 Git 一样)?


更新:

谢谢大家的回答。 Mercurial 的开发人员之一 - tonfathis answer 的评论中也回答了这个问题:

caveman: When light-weight copies areimplemented, will two files with samecontent (same hash value differentnames) store only once in repository(just like Git)?

tonfa: no, this feature isn't planned(it would break other optimizations tominimize disk access)

最佳答案

现在,当您复制文件时,系统会在存储库中创建一个新文件,其中包含您刚刚复制的文件的压缩快照。我们的想法是对其进行设置,以便副本以某种方式引用旧文件,然后具有基于该旧文件的修订日志条目,而不必拥有自己的快照来作为修订日志条目的基础。

这与 git 的工作方式不同。改变 Mercurial 以这种方式工作将非常有趣,而且不是最简单的提议。

关于Mercurial:轻量级副本/重命名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5959642/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com