Skip to content

Instantly share code, notes, and snippets.

@nchevobbe
Last active April 4, 2023 08:46
Show Gist options
  • Save nchevobbe/fd73028bd12d60beef7220ad569dfbc7 to your computer and use it in GitHub Desktop.
Save nchevobbe/fd73028bd12d60beef7220ad569dfbc7 to your computer and use it in GitHub Desktop.
hg log graph with links to Bugzilla and Phabricator
[alias]
wip = log --graph --rev=wip --template=wip
[revsetalias]
wip = (parents(not public()) or not public() or . or (head() and branch(default))) and (not obsolete() or orphan()^) and not closed() and not (fxheads() - date(-90))
ignored_changesets = desc("ignore-this-changeset") or extdata(get_ignored_changesets)
[templates]
wip = '{
label(
ifcontains(rev, revset("parents()"),
"wip.here",
"wip.{phase}"
),
"{node|short}"
)
}{
label(
"wip.user",
" {author|user}"
)
}{
if(bookmarks," ")
}{
label(
"wip.bookmarks",
if(bookmarks,bookmarks)
)
} {
bz_link()
}{
sub("^(Bug )(\d+)", "",desc|firstline)
}{
phab_link()
}'
[templatealias]
link(url,text,textlabel) = '\x1B]8;;{url}\x1B\\{label(textlabel, text)}\x1B]8;;\x1B\\'
bz_link() = '{search("^(Bug )(\d+)", desc|firstline) % link("https://bugzilla.mozilla.org/show_bug.cgi?id={2}", "Bug {2}","")}'
phab_link() = ' {search("(Differential Revision).+(D\d+)", desc) % link("https://phabricator.services.mozilla.com/{2}", "D", "wip.phab")}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment