hg 标签的 return 是什么 --template "{date|isodate}\n"
What is the return of hg tags --template "{date|isodate}\n"
我正在使用 Mercurial "HG",我想知道
的确切输出是什么
hg tags --template "{date|isodate}\n"
准备 MWE:
hg init test1
cd test1
echo test this > file.txt
hg commit -A -m "my 1st commit"
hg tag mytag1
--
现在尝试 tags
的不同模板
正常tags
输出:
hg tags
tip 1:e02e6bf615f5
mytag1 0:0970400e2de4
--
现在让我们尝试使用短格式的标签名称和标签日期 YYYY-MM-DD:
hg tags --template "{tag} {date|shortdate}\n"
tip 1970-01-01
mytag1 1970-01-01
--
最后,你问的那个(只有 ISO 日期):
hg tags --template "{date|isodate}\n"
1970-01-01 00:00 +0000
1970-01-01 00:00 +0000
--
如果您对模板过滤器有疑问:
hg help template
isodate Date. Returns the date in ISO 8601 format: "2009-08-18 13:00 +0200".
我正在使用 Mercurial "HG",我想知道
的确切输出是什么hg tags --template "{date|isodate}\n"
准备 MWE:
hg init test1
cd test1
echo test this > file.txt
hg commit -A -m "my 1st commit"
hg tag mytag1
--
现在尝试 tags
正常tags
输出:
hg tags
tip 1:e02e6bf615f5
mytag1 0:0970400e2de4
--
现在让我们尝试使用短格式的标签名称和标签日期 YYYY-MM-DD:
hg tags --template "{tag} {date|shortdate}\n"
tip 1970-01-01
mytag1 1970-01-01
--
最后,你问的那个(只有 ISO 日期):
hg tags --template "{date|isodate}\n"
1970-01-01 00:00 +0000
1970-01-01 00:00 +0000
--
如果您对模板过滤器有疑问:
hg help template
isodate Date. Returns the date in ISO 8601 format: "2009-08-18 13:00 +0200".