开发者

Mercurial templates: have "{branches}" return "default"?

What's the simplest way to have hg ... --template '{branches}' 开发者_运维问答return default instead of an empty string when the changeset being printed is part of the default branch?


I've not found an in-template way to do that. If I'm in a shellscript I do something like:

BRANCH=$(hg log --revision 0 --template '{branches}')
echo ${BRANCH:=default}

Though if you have the excellent hg prompt extension in place you could do:

hg prompt '{branch}'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜