Mercurial Log客置化的呈現 on Linux

        標題我暫時用"Mercurial  Log客置化的呈現 on Linux",主要參考以下的網頁:

http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html

       我這篇是我自己想要將我已經commit到repository的一些訊息給全部Dump出來
,所以我寫了這篇文章來紀錄。

$ hg log 
以上的指令會將全部有commit的資訊都給Dump出來,但是都是一些簡單的訊息


$ hg log -r 1

changeset:   1:107e439be01c
tag:         mytag
user:        Bryan O'Sullivan 
date:        Tue May 05 06:55:46 2009 +0000
summary:     added line to end of <> file.


上面的資料從參考網站借用一下來說明。加上 -r 再加上數字,就可以看到指定的
changeset的資料。

$ hg log --style changelog
這個指令就會將比較完整的資料給Dump出來了,以下的資料也是借用的。
他其實會將你全部commit過的資料都秀出來,還分日期並且將沒個changeset有加上
什麼檔案或刪掉什麼檔案都呈獻出來,我這邊只是大概看一下而已,還沒完全瞭解
之後再做訂正。

2009-05-05  Bryan O'Sullivan  

 * .hgtags:
 Added tag v0.1 for changeset 59abc8be7140
 [65efccbd2729] [tip]

 * .hgtags:
 Added tag mytag for changeset 107e439be01c
 [59abc8be7140] [v0.1]

 * goodbye, hello:
 added line to end of <> file.

 in addition, added a file with the helpful name (at least i hope
 that some might consider it so) of goodbye.
 [107e439be01c] [mytag]

 * hello:
 added hello
 [5ce2a492c569]

$ hg log --template 
這個指令就可以客置化自己想要看的資訊了,如果要更詳細的資料請到Reference的網站看。

$ hg log -r1 --template '{author}\n'
Bryan O'Sullivan 
$ hg log -r1 --template '{author|domain}\n'
serpentine.com
$ hg log -r1 --template '{author|email}\n'
bos@serpentine.com
$ hg log -r1 --template '{author|obfuscate}\n' | cut -c-76
Bryan O'Sulli&#11
$ hg log -r1 --template '{author|person}\n'
Bryan O'Sullivan
$ hg log -r1 --template '{author|user}\n'
bos
$ hg log -r1 --template 'looks almost right, but actually garbage: {date}\n'
looks almost right, but actually garbage: 1241506546.00
$ hg log -r1 --template '{date|age}\n'
2 seconds
$ hg log -r1 --template '{date|date}\n'
Tue May 05 06:55:46 2009 +0000
$ hg log -r1 --template '{date|hgdate}\n'
1241506546 0
$ hg log -r1 --template '{date|isodate}\n'
2009-05-05 06:55 +0000
$ hg log -r1 --template '{date|rfc822date}\n'
Tue, 05 May 2009 06:55:46 +0000
$ hg log -r1 --template '{date|shortdate}\n'
2009-05-05
$ hg log -r1 --template '{desc}\n' | cut -c-76
added line to end of <> file.

in addition, added a file with the helpful name (at least i hope that some m
$ hg log -r1 --template '{desc|addbreaks}\n' | cut -c-76
added line to end of <> file.



in addition, added a file with the helpful name (at least i hope that some m
$ hg log -r1 --template '{desc|escape}\n' | cut -c-76
added line to end of <<hello>> file.

in addition, added a file with the helpful name (at least i hope that some m
$ hg log -r1 --template '{desc|fill68}\n'
added line to end of <> file.

in addition, added a file with the helpful name (at least i hope
that some might consider it so) of goodbye.
$ hg log -r1 --template '{desc|fill76}\n'
added line to end of <> file.

in addition, added a file with the helpful name (at least i hope that some
might consider it so) of goodbye.
$ hg log -r1 --template '{desc|firstline}\n'
added line to end of <> file.
$ hg log -r1 --template '{desc|strip}\n' | cut -c-76
added line to end of <> file.

in addition, added a file with the helpful name (at least i hope that some m
$ hg log -r1 --template '{desc|tabindent}\n' | expand | cut -c-76
added line to end of <> file.

        in addition, added a file with the helpful name (at least i hope tha
$ hg log -r1 --template '{node}\n'
107e439be01c456e8e32f719558cb7ea693b60fd
$ hg log -r1 --template '{node|short}\n'
107e439be01c


留言

熱門文章