changeset 24513:b5a0b2374eb6

hgk: display obsolete changesets in darkgrey
author Andrew Shadura <andrew@shadura.me>
date Sat, 28 Mar 2015 20:05:01 +0100
parents e5c5ddc3b172
children d01c767d8753
files contrib/hgk hgext/hgk.py
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgk	Sat Mar 28 19:36:21 2015 +0100
+++ b/contrib/hgk	Sat Mar 28 20:05:01 2015 +0100
@@ -337,7 +337,7 @@
 
 proc parsecommit {id contents listed olds} {
     global commitinfo children nchildren parents nparents cdate ncleft
-    global firstparents
+    global firstparents obsolete
 
     set inhdr 1
     set comment {}
@@ -389,6 +389,8 @@
 		    set branch [join [lrange $line 1 end]]
         } elseif {$tag == "bookmark"} {
 		    set bookmark [join [lrange $line 1 end]]
+        } elseif {$tag == "obsolete"} {
+		    set obsolete($id) ""
         }
 	    }
 	} else {
@@ -1139,7 +1141,7 @@
     global lineno lthickness mainline mainlinearrow sidelines
     global commitlisted rowtextx idpos lastuse displist
     global oldnlines olddlevel olddisplist
-    global aucolormap curid curidfont
+    global aucolormap curid curidfont obsolete
 
     incr numcommits
     incr lineno
@@ -1155,6 +1157,9 @@
 	    set nparents($id) 0
 	}
     }
+    if {[info exists obsolete($id)]} {
+	set ofill darkgrey
+    }
     assigncolor $id
     set currentparents {}
     set dupparents {}
--- a/hgext/hgk.py	Sat Mar 28 19:36:21 2015 +0100
+++ b/hgext/hgk.py	Sat Mar 28 20:05:01 2015 +0100
@@ -35,7 +35,7 @@
 '''
 
 import os
-from mercurial import cmdutil, commands, patch, revlog, scmutil
+from mercurial import cmdutil, commands, patch, revlog, scmutil, obsolete
 from mercurial.node import nullid, nullrev, short
 from mercurial.i18n import _
 
@@ -128,6 +128,9 @@
         ui.write(("committer %s %s %s\n" % (committer, int(date[0]), date[1])))
     ui.write(("revision %d\n" % ctx.rev()))
     ui.write(("branch %s\n" % ctx.branch()))
+    if obsolete.isenabled(repo, obsolete.createmarkersopt):
+        if ctx.obsolete():
+            ui.write(("obsolete\n"))
     ui.write(("phase %s\n\n" % ctx.phasestr()))
 
     if prefix != "":