Changeset 20930c62b180…
Parent 6efb078daff9…
by
Changes to 3 files · Browse files at 20930c62b180 Showing diff from parent 6efb078daff9 Diff from another changeset...
@@ -155,9 +155,9 @@
changeset hash link:
>>> htmlize('foo af50a62e9c20 bar')
- u'foo <a href="rev_hash_af50a62e9c20">af50a62e9c20</a> bar'
+ u'foo <a href="cset:af50a62e9c20">af50a62e9c20</a> bar'
>>> htmlize('af50a62e9c2040dcdaf61ba6a6400bb45ab56410') # doctest: +ELLIPSIS
- u'<a href="rev_hash_af...10">af...10</a>'
+ u'<a href="cset:af...10">af...10</a>'
http/https links:
>>> s = htmlize('foo http://example.com:8000/foo?bar=baz&bax#blah')
@@ -173,8 +173,6 @@ regexp = r'%s|%s' % (csmatch, httpmatch)
bodyre = re.compile(regexp)
- revhashprefix = 'rev_hash_'
-
def htmlize(desc):
"""Mark up ctx.description() [localstr] as an HTML [unicode]"""
desc = unicode(Qt.escape(hglib.tounicode(desc)))
@@ -189,7 +187,7 @@ groups = m.groups()
if groups[0]:
cslink = groups[0]
- buf += '<a href="%s%s">%s</a>' % (revhashprefix, cslink, cslink)
+ buf += '<a href="cset:%s">%s</a>' % (cslink, cslink)
if groups[1]:
urllink = groups[1]
buf += '<a href="%s">%s</a>' % (urllink, urllink)
|
@@ -19,8 +19,6 @@
from tortoisehg.hgqt import qtlib
-revhashprefix = 'rev_hash_'
-
class RevMessage(QWidget):
revisionLinkClicked = pyqtSignal(str)
@@ -47,8 +45,8 @@
def anchorClicked(self, qurl):
link = str(qurl.toString())
- if link.startswith(revhashprefix):
- rev = link[len(revhashprefix):]
+ if link.startswith('cset:'):
+ rev = link[len('cset:'):]
self.revisionLinkClicked.emit(rev)
else:
QDesktopServices.openUrl(qurl)
|
@@ -94,7 +94,7 @@ mrevid = revid_markup('%s (%s)' % (revnum, revid))
if not enable:
return mrevid
- link = 'cset://%s:%s' % (revnum, revid)
+ link = 'cset:%s' % revid
return '<a href="%s">%s</a>' % (link, mrevid)
def revline_markup(revnum, revid, summary, highlight=None,
branch=None, link=True):
@@ -145,8 +145,8 @@ @pyqtSlot(unicode)
def _maplink(self, link):
link = unicode(link)
- if link.startswith('cset://'):
- self.revisionLinkClicked.emit(link[7:].split(':')[0])
+ if link.startswith('cset:'):
+ self.revisionLinkClicked.emit(link[5:])
revpanel.__class__ = RevPanelWidget_
revpanel.linkActivated.connect(revpanel._maplink)
|
Loading...