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.
# Copyright (c) 2009-2010 LOGILAB S.A. (Paris, FRANCE).# http://www.logilab.fr/ -- mailto:contact@logilab.fr## This program is free software; you can redistribute it and/or modify it under# the terms of the GNU General Public License as published by the Free Software# Foundation; either version 2 of the License, or (at your option) any later# version.## This program is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.## You should have received a copy of the GNU General Public License along with# this program; if not, write to the Free Software Foundation, Inc.,# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.frommercurial.nodeimportshortasshort_hexfromPyQt4importQtCore,QtGuiQt=QtCore.Qtconnect=QtCore.QObject.connectSIGNAL = QtCore.SIGNAL
from tortoisehg.util.util import format_desc, xml_escape
+from tortoisehg.util import hglibfrom tortoisehg.hgqt.config import HgConfig
headerstyle='''<style type="text/css">
.rev_number { font-family:Courier; }
.rev_hash { font-family:Courier; }
+.label { color:gray; }</style>
'''
classRevDisplay(QtGui.QWidget):""" Display metadata for one revision (rev, author, description, etc.) """def__init__(self,parent=None):QtGui.QWidget.__init__(self,parent)self._message=Nonevb=QtGui.QVBoxLayout()vb.setMargin(0)self._header=w=QtGui.QLabel()w.setTextInteractionFlags(Qt.TextSelectableByMouse|Qt.LinksAccessibleByMouse)vb.addWidget(w) self.setLayout(vb)
- self.descwidth = 60 # number of chars displayed for parent/child descriptions
+ self.descwidth = 80 # number of chars displayed for parent/child descriptions
connect(self._header,
SIGNAL('linkActivated(const QString&)'),
self.anchorClicked)defsizeHint(self):returnself.minimumSizeHint()defminimumSizeHint(self):returnself._header.minimumSizeHint()defsetMessageWidget(self,w):self._message=wdefanchorClicked(self,qurl):""" Callback called when a link is clicked in the text browser """rev=str(qurl)ifrev.startswith('diff_'):self.diffrev=int(rev[5:])self.refreshDisplay()# TODO: emit a signal to recompute the diffself.emit(SIGNAL('parentRevisionSelected'),self.diffrev)else:self.emit(SIGNAL('revisionSelected'),int(rev))defsetDiffRevision(self,rev):ifrev!=self.diffrev:self.diffrev=revself.refreshDisplay()defdisplayRevision(self,ctx):self.ctx=ctxself.diffrev=ctx.parents()[0].rev()ifhasattr(self.ctx._repo,"mq"):self.mqseries=self.ctx._repo.mq.series[:]self.mqunapplied=[x[1]forxinself.ctx._repo.mq.unapplied(self.ctx._repo)]mqpatch=set(self.ctx.tags()).intersection(self.mqseries)ifmqpatch:self.mqpatch=mqpatch.pop()else:self.mqpatch=Noneelse:self.mqseries=[]self.mqunapplied=[]self.mqpatch=Noneself.refreshDisplay()defselectNone(self):self._message.selectNone()defsearchString(self,text):self._message.searchString(text)defrefreshDisplay(self): ctx = self.ctx
rev = ctx.rev()
buf = headerstyle
- buf += "<table width=100%>\n" if self.mqpatch:
+ buf += "<table width=100%>\n" buf += '<tr bgcolor=%s>' % HgConfig(ctx._repo.ui).getMQFGColor()
buf += '<td colspan=3 width=100%><b>Patch queue:</b> '
for p in self.mqseries:
ifpinself.mqunapplied:p="<i>%s</i>"%pelifp==self.mqpatch: p = "<b>%s</b>" % p
buf += ' %s ' % (p)
buf += '</td></tr>\n'
+ buf += "</table>\n"- buf += '<tr>'
+ buf += '<table width=100%>\n<tr>'
if rev is None:
- buf += "<td><b>Working Directory</b></td>\n"+ buf += '<td><b>Working Directory</b></td>' else:
- buf += '<td><b>Revision:</b> '\
- '<span class="rev_number">%d</span>:'\- '<span class="rev_hash">%s</span></td>'\
- '\n' % (ctx.rev(), short_hex(ctx.node()))+ desc = format_desc(ctx.description(), 80)+ buf += '<td><b><span class="rev_number">%d:</span>'\+ '<span class="rev_hash">%s </span>'\
+ '<span class="short_desc">%s</span></b></td>'\
+ '\n' % (ctx.rev(), short_hex(ctx.node()), desc)+ buf += '<td width=50 align=right><span class="label">Branch </span></td>'\+ '<td>%s</td>'\+ '\n' % ctx.branch()+ buf += '</tr></table>\n'- buf += '<td><b>Author:</b> '\- '%s</td>'\
- '\n' % unicode(ctx.user(), 'utf-8', 'replace')
- buf += '<td><b>Branch:</b> %s</td>' % ctx.branch()- buf += '</tr>'- buf += "</table>\n"- buf += "<table width=100%>\n"+ buf += '<table width=100%>\n'+ buf += '<tr><td width=50 align="right"><span class="label">Author </span></td>'\+ '<td colspan=5>%s</td></tr>'\
+ '\n' % xml_escape(unicode(ctx.user(), 'utf-8', 'replace'))+ d = ctx.date()+ buf += '<tr><td width=50 align="right"><span class="label">Date </span></td>'\+ '<td>%s (%s)</td></tr>'\+ '\n' % (hglib.displaytime(d), hglib.age(d))+ parents = [p for p in ctx.parents() if p]
for p in parents:
if p.rev() > -1:
short=short_hex(p.node())desc=format_desc(p.description(),self.descwidth) p_rev = p.rev()
p_fmt = '<span class="rev_number">%s</span>:'\
'<a href="%s" class="rev_hash">%s</a>'
- if p_rev == self.diffrev:- p_rev = '<b>%s</b>' % (p_fmt % (p_rev, p_rev, short))- else:- p_rev = p_fmt % ('<a href="diff_%s" class="rev_diff">%s</a>' % (p_rev, p_rev), p_rev, short)
- buf += '<tr><td width=50 class="label"><b>Parent:</b></td>'\
- '<td colspan=5>%s '\
- '<span class="short_desc">%s</span></td></tr>'\
+ p_rev = p_fmt % (p_rev, p_rev, short)
+ buf += '<tr><td width=50 align="right"><span class="label">Parent </span></td>'\
+ '<td>%s'\
+ '<span class="short_desc"> %s</span></td></tr>'\
'\n' % (p_rev, desc)
if len(parents) == 2:
p = parents[0].ancestor(parents[1])
short=short_hex(p.node())desc=format_desc(p.description(),self.descwidth) p_rev = p.rev()
p_fmt = '<span class="rev_number">%s</span>:'\
'<a href="%s" class="rev_hash">%s</a>'
- if p_rev == self.diffrev:- p_rev = '<b>%s</b>' % (p_fmt % (p_rev, p_rev, short))- else:- p_rev = p_fmt % ('<a href="diff_%s" class="rev_diff">%s</a>' % (p_rev, p_rev), p_rev, short)
- buf += '<tr><td width=50 class="label"><b>Ancestor:</b></td>'\
- '<td colspan=5>%s '\
+ p_rev = p_fmt % (p_rev, p_rev, short)
+ buf += '<tr><td width=50 align="right"><span class="label">Ancestor</span></td>'\
+ '<td>%s '\
'<span class="short_desc">%s</span></td></tr>'\
'\n' % (p_rev, desc)
forpinctx.children(): if p.rev() > -1:
short = short_hex(p.node())
desc = format_desc(p.description(), self.descwidth)
- buf += '<tr><td class="label"><b>Child:</b></td>'\
- '<td colspan=5><span class="rev_number">%d</span>:'\
+ buf += '<tr><td align="right"><span class="label">Child </span></td>'\
+ '<td><span class="rev_number">%d</span>:'\
'<a href="%s" class="rev_hash">%s</a> '\
'<span class="short_desc">%s</span></td></tr>'\
'\n' % (p.rev(), p.rev(), short, desc)
buf+="</table>\n"self._header.setText(buf)self._message.displayRevision(ctx)classRevMessage(QtGui.QWidget):def__init__(self,parent=None):QtGui.QWidget.__init__(self,parent)vb=QtGui.QVBoxLayout()vb.setMargin(0)self._message=w=QtGui.QTextBrowser()vb.addWidget(w)self.setLayout(vb)defdisplayRevision(self,ctx):self.ctx=ctxdesc=xml_escape(unicode(ctx.description(),'utf-8','replace'))desc=desc.replace('\n','<br/>\n')buf='<div class="diff_desc"><p>%s</p></div>'%descself._message.setHtml(buf)defselectNone(self):msg=self._messagecursor=msg.textCursor()cursor.clearSelection()cursor.setPosition(0)msg.setTextCursor(cursor)msg.setExtraSelections([])defsearchString(self,text):msg=self._messageself.selectNone()iftextinunicode(msg.toPlainText()):clist=[]whilemsg.find(text):eselect=msg.ExtraSelection()eselect.cursor=msg.textCursor()eselect.format.setBackground(QtGui.QColor('#ffffbb'))clist.append(eselect)self.selectNone()msg.setExtraSelections(clist)deffinditer(msg,text):iftext:whileTrue:ifmsg.find(text):yieldself.ctx.rev(),Noneelse:breakreturnfinditer(msg,text)
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.