如何列出 mercurial 中两个更改集之间的所有(新)添加文件?

How can I list all (new) added files between two change sets in mercurial?

如何在 Mercurial 中的两个更改集之间列出所有(新)添加的文件?

我可以使用 hg status --rev x:y 获取两次修订之间的所有更改,但如果我只想获取新文件怎么办?

hg help revsets + hg help templates 用于 hg log -r … -T … 命令

"x::y" 
A DAG range, meaning all changesets that are descendants of x and ancestors of y,
including x and y themselves. 

良好的正确范围

file_adds 
List of strings. Files added by this changeset

模板关键字

>hg log -T {file_adds}\n
file3.txt file4.txt
file2.txt
file1.txt

(最后的变更集添加了 2 个文件)

>hg log -T "{file_adds % '{file}\n'}"
file3.txt
file4.txt
file2.txt
file1.txt

刚刚添加了列表格式