Mercurial log with one-liners

后端 未结 3 906
遇见更好的自我
遇见更好的自我 2021-02-01 03:14

The regular hg log command gives output with at least 4 lines per changeset. For example

changeset:   238:03a214f2a1cf
user:        My Name 

        
3条回答
  •  渐次进展
    2021-02-01 03:46

    To get the description on one line even if original comment contains multiple line combine a splitlines and join function like below:

    {join(splitlines(desc), ' ')}
    

    Here is an example i'm using to extract data as CSV:

    hg log --template "{node};{date|shortdate};{branch};{author};{join(splitlines(desc), ' ')};{diffstat};files: {join(files, ', ')}\n"
    

提交回复
热议问题