Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
''' Mercurial revision DAG visualization library Implements a gtk.TreeModel which visualizes a Mercurial repository revision history.Portions of this code stolen mercilessly from bzr-gtk visualizationdialog. Other portions stolen from graphlog extension.'''importgtkimportgobjectimportrefrom time import (strftime, gmtime)
from mercurial import util
+# FIXME: dirty hack to import toutf() from hggtk.hglib.+#+# Python 2.5's relative imports doesn't seem to work either,+# when running history.py directly.+#+# Besides, we want to be compatible older Python versions.+try:+ # when history.py is invoked directly+ from hglib import toutf+except ImportError:+ # when history.py is imported and called from hgproc.py+ from hggtk.hglib import toutf+# treemodel row enumerated attributes
LINES = 0
NODE = 1
REVID=2LAST_LINES=3MESSAGE=4COMMITER=5TIMESTAMP=6REVISION=7PARENTS=8WCPARENT=9HEAD=10TAGS=11MARKED = 12
FGCOLOR = 13
-# FIXME:-# this function is a copy of hglib.touft(), but I've -# trouble importing hglib (resides one dir level above )-# into this module.-#-# Note: Python 2.5's new import syntax causes problem-# when importing this module from command line.-def toutf(s):- """- Convert a string to UTF-8 encoding- """- for e in ('utf-8', util._encoding):- try:- return s.decode(e, 'strict').encode('utf-8')- except UnicodeDecodeError:- pass- return s.decode(util._fallbackencoding, 'replace').encode('utf-8')-class TreeModel(gtk.GenericTreeModel):
def __init__ (self, repo, graphdata, color_func):
gtk.GenericTreeModel.__init__(self)self.revisions={}self.repo=repoself.parents=[x.rev()forxinrepo.workingctx().parents()]self.heads=[repo.changelog.rev(x)forxinrepo.heads()]self.line_graph_data=graphdataself.author_re=re.compile('<.*@.*>',0)self.color_func=color_funcdefon_get_flags(self):returngtk.TREE_MODEL_LIST_ONLYdefon_get_n_columns(self):return14defon_get_column_type(self,index):ifindex==NODE:returngobject.TYPE_PYOBJECTifindex==LINES:returngobject.TYPE_PYOBJECTifindex==REVID:returngobject.TYPE_STRINGifindex==LAST_LINES:returngobject.TYPE_PYOBJECTifindex==MESSAGE:returngobject.TYPE_STRINGifindex==COMMITER:returngobject.TYPE_STRINGifindex==TIMESTAMP:returngobject.TYPE_STRINGifindex==REVISION:returngobject.TYPE_PYOBJECTifindex==PARENTS:returngobject.TYPE_PYOBJECTifindex==WCPARENT:returngobject.TYPE_BOOLEANifindex==HEAD:returngobject.TYPE_BOOLEANifindex==TAGS:returngobject.TYPE_STRINGifindex==MARKED:returngobject.TYPE_BOOLEANifindex==FGCOLOR:returngobject.TYPE_STRINGdefon_get_iter(self,path):returnpath[0]defon_get_path(self,rowref):returnrowrefdefon_get_value(self,rowref,column):(revid,node,lines,parents)=self.line_graph_data[rowref]ifcolumn==REVID:returnrevidifcolumn==NODE:returnnodeifcolumn==LINES:returnlinesifcolumn==PARENTS:returnparentsifcolumn==LAST_LINES:ifrowref>0:returnself.line_graph_data[rowref-1][2]return[]ifrevidnotinself.revisions:ctx=self.repo.changectx(revid)summary=ctx.description().replace('\0','')summary=summary.split('\n')[0]summary=gobject.markup_escape_text(toutf(summary))node=self.repo.lookup(revid)tags=toutf(', '.join(self.repo.nodetags(node)))if'<'inctx.user():author=toutf(self.author_re.sub('',ctx.user()).strip(' '))else:author=toutf(util.shortuser(ctx.user()))date=strftime("%Y-%m-%d %H:%M:%S",gmtime(ctx.date()[0]))wc_parent=revidinself.parentshead=revidinself.headscolor=self.color_func(parents,revid,author)revision=(None,node,revid,None,summary,author,date,None,parents,wc_parent,head,tags,None,color)self.revisions[revid]=revisionelse:revision=self.revisions[revid]ifcolumn==REVISION:returnrevisionifcolumn==MARKED:returnrevid==self.marked_revreturnrevision[column]defon_iter_next(self,rowref):ifrowref<len(self.line_graph_data)-1:returnrowref+1returnNonedefon_iter_children(self,parent):ifparentisNone:return0returnNonedefon_iter_has_child(self,rowref):returnFalsedefon_iter_n_children(self,rowref):ifrowrefisNone:returnlen(self.line_graph_data)return0defon_iter_nth_child(self,parent,n):ifparentisNone:returnnreturnNonedefon_iter_parent(self,child):returnNone
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.