我有一个修改哈希键。我想得到包含任何内容的最接近的修订版,但.hgtags除外。
例如,考虑到汞历史的以下片段:
D:\CI\NC\8.0>hg log -l3 -b 8.0 -v
changeset: 1768:633cf1f61665
branch: 8.0
tag: tip
user: ci
date: Wed Nov 16 21:06:20 2011 +0200
files: .hgtags
description:
Replaced tag 'good.NC.16' with 'rejected.NC.16' for changeset 9451e8f187b1
changeset: 1767:6cad328c622c
branch: 8.0
parent: 1765:9451e8f187b1
user: ci
date: Wed Nov 16 21:04:26 2011 +0200
files: .hgtags
description:
Added tag 'good.NC.16' for changeset 9451e8f187b1
changeset: 1765:9451e8f187b1
branch: 8.0
tag: rejected.NC.16
user: gilad
date: Tue Nov 15 18:26:09 2011 +0200
files: .hgignore
description:
update在这种情况下,如果给定的修订是633cf1f61665,那么我将查找修订9451e8f187b1,因为它是最近的版本,它不仅包含.hgtags,还包含其他内容。
给定633cf1f61665,如何使用尽可能少的hg.exe调用来定位9451e8f187b1?
编辑
我已经修正了输出,它应该显示来自同一个分支的修订。
EDIT2
我会尽力解释自己的。让我们定义两个概念:
hg tag行动创造的变化。所以,我的问题可以这样改写:
Given an arbitrary revision (dull or interesting) I need to find the closest
interesting revision belonging to the same named branch using as few hg invocations
as possible.例如,给定633cf1f61665、6cad328c622c或9451e8f187b1,所需的修订是9451e8f187b1。
发布于 2011-11-17 10:10:36
试着
$ hg log -r "max(::REV and not file(.hgtags))"看看能不能做你想要的。有关查询语言的更多信息,请参见hg help revsets。
如果经常使用该别名,则可以为此创建一个重新设置别名:
[revsetalias]
interesting($1) = max(::$1 and not file(.hgtags))然后在将来使用hg log -r "interesting(123)"。
https://stackoverflow.com/questions/8163689
复制相似问题