生成 hg 版本之间更改的文件的列表
我想生成 Mercurial 中给定目录中两个版本之间更改的文件列表。
特别是,我对该目录中的什么更改不感兴趣,而是哪些文件发生了更改。
例如,假设在 then
和 otherthen
之间,只有 2 个文件发生了变化:
>hg hypothetical-command -r then:otherthen
foo.baz
bar.baz
>
假设的命令是什么?我已经尝试过 diff 和 log,但我不知道如何说服他们这样做:要么我得到补丁(diff),要么我得到整个 repo(log)。
I want to generate a list of which files changed between two revisions in a given directory in Mercurial.
In particular, I am not interested in what changed, but which files changed in that directory.
E.g., supposing that between then
and otherthen
, only 2 files changed:
>hg hypothetical-command -r then:otherthen
foo.baz
bar.baz
>
What's the hypothetical command? I've tried diff and log, but I can't see how to convince them to do it: either I get the patch(diff), or I get the whole repo(log).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
其中
x
和y
是所需的修订号(或标签或分支名称)。如果您在 Windows 中使用终端,请添加
hg status --rev x:y
> your-file.txt
将列表保存到文件中。where
x
andy
are desired revision numbers (or tag or branch names).If you are using the terminal in windows add
hg status --rev x:y
> your-file.txt
to save the list to a file.状态就是您所需要的。
但是,根据“两个修订之间”的含义,您也可以考虑使用“x::y”(DAG - 有向无环图)范围。
给定并行变更集,
1--2---4
\---3
hg status --rev 1:4
将返回 (1,2,3,4),即端点之间(包括端点)的任何内容,根据本地数字rev。这可能(并且很可能会)在其他(尽管相关)存储库中返回不同的结果!
hg status --rev 1::4
将返回 (1,2,4),即端点,以及作为“1”的后代和“4”的祖先的所有变更集。
后一种情况 x::y 通常在实际应用中更有用。这是您通过 TortoiseHg\Visual Diff 获得的。
>hg 帮助转速:
status is what you need.
But, depending what you mean by "between two revisions", you might also consider using the "x::y" (DAG - Directed Acyclic Graph) range.
Given parallel changesets,
1--2---4
\---3
hg status --rev 1:4
would return (1,2,3,4),i.e. anything between and including the endpoints, according to the local, numerical rev. This might (and most probably will) return different results in other - though related - repositories!
hg status --rev 1::4
would return (1,2,4),i.e. the endpoints, and all changesets which are descendants of '1' AND ancestors of '4'.
The latter case, x::y, is usually more useful in real-world applications. This is what you get via TortoiseHg\Visual Diff.
>hg help revsets: