[英]Printing transplant source changeset hash
We've transplanted a changeset from another repository to the current one. 我们已经将变更集从另一个存储库移植到当前存储库。 It seems to us that the transplant extensions stores the original changset hash in an extra field which can be shown with
hg log --debug
, like: 在我们看来,移植扩展将原始changset哈希存储在一个额外的字段中,可以使用
hg log --debug
来显示,例如:
changeset: 720:092506
tag: tip
parent: ...
parent: ...
manifest: ...
user: ...
date: ...
files: ...
extra: branch=default
extra: transplant_source=\xe3>\xa7py\xff\xcda\x93d\xde\xa5\xb5\xa6\xf7\xed\xc0\x16\x82\xa3
description:
Bugfix, ...
Here the original changset hash ( transplant_source
) is not too readable and usable. 在这里,原始的changset哈希值(
transplant_source
)不太易读和无法使用。 How can we print the transplant_source
in a readable format with hg log
command? 我们怎样才能打印
transplant_source
与可读格式hg log
命令?
I've played with ifeq
and the list operator without success. 我玩过
ifeq
和list运算符没有成功。
令人作呕,并且没有回答问题,但似乎可以正常工作(Python 2)::)
hg log --debug | python -c "import sys, re; x=re.compile(r'^extra:\\\\s+transplant_source='); print '\\\\n'.join([l.split('=',1)[0]+'='+eval('\\"'+l.split('=',1)[1].strip()+'\\"').encode('hex') if x.match(l) else l.rstrip('\\\\n') for l in sys.stdin])"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.