剥离hg日期

时间:2011-12-05 04:41:45

标签: mercurial windows-xp

使用时

hg log --template "{date|isodate} --- {rev}:{node|short} --- ... "

2011-10-07 19:25 -0400 --- 1:c608cbb9aaa3 --- ... 

剥离时区(-0400)部分的最简单方法是什么?我只想要没有时区的上述格式的日期和时间。

“...”是模板/日志消息的其余部分。不要理会他们。

此外,当人们想要进一步修改日志输出文本时,通常最好的方法是什么?

1 个答案:

答案 0 :(得分:1)

template filter (shortdate,isodate,rfcdate,... full list here)都没有提出您所追求的输出类型。

因此必须涉及某种输出过滤(awk,sed,cut,...),如(未测试)

hg log --template "{date|isodate} --- {rev}:{node|short} --- ... " |  sed 's/-[0-9][0-9][0-9][0-9] //g')
相关问题