Can I put space characters as separators only if I have any Tag or Bookmark?
Example:
hg log --template "{rev} {author} {tags} {bookmarks} {desc|firstline}\n"
Output:
3: Author1 TIP BKMRK_NAME Another commit
2: Author1 Third commit
1: Author1 TAG1 Second commit
0: Author1 Initial commit
The changesets that don't have Tags or Bookmarks prints the space characters. I'd like to suppress those extra spaces:
3: Author1 TAG_NAME BKMRK_NAME Another commit
2: Author1 Third commit
1: Author1 TAG1 Second commit
0: Author1 Initial commit
With a recent Mercurial (after 2.5), you can use the if template expression:
hg log --template '{rev} {author}{if(tags, " {tags}")}{if(bookmarks," {bookmarks}")} {desc|firstline}\n'
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