【问题标题】:What is the return of hg tags --template "{date|isodate}\n"hg标签返回什么--template "{date|isodate}\n"
【发布时间】:2019-07-22 14:11:03
【问题描述】:

我正在使用 Mercurial "HG",我想知道

的确切输出是什么
hg tags --template "{date|isodate}\n"

【问题讨论】:

    标签: mercurial tortoisehg


    【解决方案1】:

    准备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 日期。以 ISO 8601 格式返回日期:“2009-08-18 13:00 +0200”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-14
      • 1970-01-01
      • 2010-12-02
      • 2017-01-20
      • 2017-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多