Mercurial log interface

牧云@^-^@ 提交于 2019-12-10 13:39:38

问题


I've been going through the tutorial at hginit.com, but I've found a rather inconvenient aspect of the hg log feature. Basically, when I type it, I get the newest changes on top, and the oldest at the bottom. But this is simply annoying, as most of the time, you want to see the newest revisions. So... say I have 100 changesets, and I want to have a look over the 98th one. Do I scroll all the way up? Or is there a way to make Hg (Mercurial) list the changes the other way around?


回答1:


Use hg log -r:




回答2:


Just limit the display of hg log with -l/--limit.

E.g. hg log -l 100 to only display 100 changes.

If you want to avoid scrolling, you can also pipe the output to a pager (e.g. hg log | less) or use the pager extension.




回答3:


hg log | tail -r



回答4:


For me second part of @tonfa's answer is the right one, useful in all cases (you can search with /, etc...)

If you want to avoid scrolling, you can also pipe the output to a pager (e.g. hg log | less) or use the pager extension.

By now, seems if you want the pager to work with your alias you must say specifically on your .hgrc (the same for hg help, esencial)

Example

[extensions]
pager =  

[pager]
pager = LESS='FRX' less
attend = help logg

[alias]
logg = log -G --template '\x1B[33m{node|short}\x1B[0m | {date|isodatesec} | \x1B[32m{author|user}\x1B[0m: {desc|strip|firstline}\n'


来源:https://stackoverflow.com/questions/3386758/mercurial-log-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!