[英]How do you find the changesets between two tags in mercurial?
If I have two tags named 2.0 and 2.1, how do I find the changeset messages between the two? 如果我有两个名为2.0和2.1的标签,我如何在两者之间找到变更集消息? I'm trying to find to a way to use HG make release notes and list the different messages associated with the commits. 我正在尝试找到一种方法来使用HG make发行说明并列出与提交相关的不同消息。
Example Changeset: 示例变更集:
changeset: 263:5a4b3c2d1e user: User Name <user.name@gmail.com> date: Tue Nov 27 14:22:54 2018 -0500 summary: Added tag 2.0.1 for changeset 9876fghij
Desired Output: 期望的输出:
Added tag 2.1 for changeset 67890pqrst Change Info... Added tag 2.0.1 for changeset 9876fghij Change Info... Added tag 2.0 for changeset klmno12345
Preface 前言
"Any challenge has a simple, easy-to-understand wrong decision". “任何挑战都有一个简单易懂的错误决定”。 And Boris's answer is a nicest illustration for this rule: "::" topo-range will produce good results only in case of pure single-branch development (which is, in common, The Bad Idea (tm) anyway) 而鲍里斯的答案是这条规则的最好的例子:“::”topo-range 只会在纯粹的单分支开发的情况下产生良好的结果(无论如何,共同的是, 坏主意(tm) )
Face 面对
Good solution must correctly handle complex DAGs and answer on question "New changesets included in NEW, missing in OLD (regardless of the nature of occurrence)" 好的解决方案必须正确处理复杂的DAG并回答问题“新的变更集包括在新的,在OLD中丢失(无论发生的性质)”
For me it's "only()" functions in revsets with both parameters 对我来说,这是两个参数的revsets中的“only()”函数
"only(set, [set])" “只有(设置,[设置])”
Changesets that are ancestors of the first set that are not ancestors of any other head in the repo. 作为第一组祖先的变更集不是repo中任何其他head的祖先。 If a second set is specified, the result is ancestors of the first set that are not ancestors of the second set (ie ::set1 - ::set2). 如果指定了第二个集合,则结果是第一个集合的祖先不是第二个集合的祖先(即:: set1 - :: set2)。
hg log -r "only(2.1,2.0)"
maybe for better presentation powered by predefined style "changelog" 也许是为了更好的演示,由预定义的风格“changelog”驱动
hg log -r "only(2.1,2.0)" -s changelog
or custom style|template 或自定义样式|模板
You'll want to use a revset to select all changesets between two tags, for example: 2.0::2.1
will likely do the trick. 您将需要使用revset来选择两个标记之间的所有变更集,例如: 2.0::2.1
可能会起作用。 You can validate the selected changesets by running: hg log -G -r '2.0::2.1'
. 您可以通过运行以下命令来验证所选的变更集: hg log -G -r '2.0::2.1'
。 (See hg help revset
for more information about revsets). (有关hg help revset
的更多信息,请参阅hg help revset
revset)。
Once you have the right selected changesets, you can now apply a template to retrieve only the needed information. 获得正确选择的更改集后,您现在可以应用模板来仅检索所需的信息。 For example if you only want the first line of changeset description, you can do hg log -r '2.0::2.1' -T '{desc}\\n'
for the whole description or hg log -r '2.0::2.1' -T '{desc|firstline}\\n'
only for the first line of each changeset description. 例如,如果您只想要第一行变更集描述,则可以为整个描述执行hg log -r '2.0::2.1' -T '{desc}\\n'
或hg log -r '2.0::2.1' -T '{desc|firstline}\\n'
仅针对每个变更集描述的第一行。
If you want to add even more information, hg help template
is your friend. 如果您想添加更多信息,请将hg help template
作为您的朋友。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.