# HG changeset patch # User Andrew Shadura # Date 2015-04-03 20:44:25 # Node ID ce8dd4fd2d5dac8b0d3eb78bb79d869a2e11f98e # Parent e74f819e9160f8529c1238fa5b9c9860f119d68b hgk: display committer name when set by hg-git diff --git a/contrib/hgk b/contrib/hgk --- a/contrib/hgk +++ b/contrib/hgk @@ -2516,6 +2516,9 @@ proc selectline {l isnew} { } $ctext insert end "User: [lindex $info 1]\n" $ctext insert end "Date: [lindex $info 2]\n" + if {[lindex $info 3] ne ""} { + $ctext insert end "Committer: [lindex $info 3]\n" + } if {[info exists idbookmarks($id)]} { $ctext insert end "Bookmarks:" foreach bookmark $idbookmarks($id) { diff --git a/hgext/hgk.py b/hgext/hgk.py --- a/hgext/hgk.py +++ b/hgext/hgk.py @@ -117,15 +117,11 @@ def catcommit(ui, repo, n, prefix, ctx=N date = ctx.date() description = ctx.description().replace("\0", "") - lines = description.splitlines() - if lines and lines[-1].startswith('committer:'): - committer = lines[-1].split(': ')[1].rstrip() - else: - committer = "" + ui.write(("author %s %s %s\n" % (ctx.user(), int(date[0]), date[1]))) - ui.write(("author %s %s %s\n" % (ctx.user(), int(date[0]), date[1]))) - if committer != '': - ui.write(("committer %s %s %s\n" % (committer, int(date[0]), date[1]))) + if 'committer' in ctx.extra(): + ui.write(("committer %s\n" % ctx.extra()['committer'])) + ui.write(("revision %d\n" % ctx.rev())) ui.write(("branch %s\n" % ctx.branch())) if obsolete.isenabled(repo, obsolete.createmarkersopt):