Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.2, 1.9.3, and 2.0

revmessage, revpanel: unify prefix of changeset-link as 'cset:{nodeid}'

Changeset 20930c62b180

Parent 6efb078daff9

by Yuya Nishihara

Changes to 3 files · Browse files at 20930c62b180 Showing diff from parent 6efb078daff9 Diff from another changeset...

 
155
156
157
158
 
159
160
 
161
162
163
 
173
174
175
176
177
178
179
180
 
189
190
191
192
 
193
194
195
 
155
156
157
 
158
159
 
160
161
162
163
 
173
174
175
 
 
176
177
178
 
187
188
189
 
190
191
192
193
@@ -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
20
21
22
23
24
25
26
 
47
48
49
50
51
 
 
52
53
54
 
19
20
21
 
 
22
23
24
 
45
46
47
 
 
48
49
50
51
52
@@ -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
95
96
97
 
98
99
100
 
145
146
147
148
149
 
 
150
151
152
 
94
95
96
 
97
98
99
100
 
145
146
147
 
 
148
149
150
151
152
@@ -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)