views:

62

answers:

3

I've started using Hg (Mercurial) as my SCM client, just to get my feet wet with it (I'm the only guy working on the project, so yeah, no need for the more advanced features yet). 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? Thanks!

A: 

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.

tonfa
No, this is not what I had in mind. So basically, when I write `hg log`, I get something like*latest change*\*second latest change*\*thirst latest change*\*...*\*first change*\But I want it to be*first change*\*second change*\*...*\*latest change*\I don't need to limit the number of changesets displayed.
XLR3204S
Umm, if you limit the number of changes to 5, then you'll see latest change, second latest change, ..., fourth latest change, fifth latest change.
ebynum
@XLR3204S, I think your problem is because the latest changes are on top. So you want to avoid scrolling? Just use a pager, or display less revisions (with `--limit`).
tonfa
+1  A: 
hg log | tail -r
David Sykes
+3  A: 

Use hg log -r:

Niall C.
Both this and David Sykes' responses work, so I've upvoted both. I'm choosing this because I have to choose an 'accepted answer' and this is the shorter way :)
XLR3204S
It's clearly the better way, I also upvoted, but left mine in as it might be helpful
David Sykes