I want my "hg h" (an hg log alias's output) to show what my currently working revision is in the context of the history/log.
On my .hgrc I have the following:
[alias]
h = log --template "{rev} {node|short} {date|shortdate} | [{author|user}] {desc|strip|firstline} :: {tags}\n"
Here's a sample output:
$ hg h
1 f130b4194c90 2011-07-21 | [slashfoo] added a comment :: tip
0 f4b4ec3c8c95 2011-07-21 | [slashfoo] initial commit ::
But if I update to revision 0, the output is still the same:
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg h
1 f130b4194c90 2011-07-21 | [slashfoo] added a comment :: tip
0 f4b4ec3c8c95 2011-07-21 | [slashfoo] initial commit ::
An example desired output would be:
$ hg h
1 f130b4194c90 2011-07-21 | [slashfoo] added a comment :: tip
0 f4b4ec3c8c95 2011-07-21 | [slashfoo] initial commit :: [working]
note: that [working] is NOT a tag, just my working revision, the one I updated-to.
Another example could be:
$ hg h
1 f130b4194c90 2011-07-21 | | [slashfoo] added a comment :: tip
0 f4b4ec3c8c95 2011-07-21 |X| [slashfoo] initial commit ::
I customized my "hg h" output using the hgbook's entry on "Customizing the output of Mercurial" http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html
Alternatives to what I want to do could be:
hg h -G
so that an @ would denote current working revisionhg id
to know what revision I amhg parents
to know what revision I am with some extra infoBut only alternative #1 shows me the context, but hg log -G and aliases are a bit less "compact" than my desired output.
Here's a sample of the output of alternative #1
$ hg h -G
o 1 f130b4194c90 2011-07-21 | [slashfoo] added a comment :: tip
|
@ 0 f4b4ec3c8c95 2011-07-21 | [slashfoo] initial commit ::
This question is simmilar to How can I find my working revision in mercurial but I want it in context, and in a compact manner (i.e. without -G)
hg log --rev $(hg id -i | sed 's/.$//')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With