Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py

changeset 3702
dabc69b82c7c
parent 3656
441956d8fce5
child 3715
eabefe4e41a4
equal deleted inserted replaced
3701:864226db1abe 3702:dabc69b82c7c
13 except NameError: 13 except NameError:
14 pass 14 pass
15 15
16 import os 16 import os
17 17
18 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, QUrl, QByteArray 18 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, QUrl
19 from PyQt5.QtGui import QTextCursor 19 from PyQt5.QtGui import QTextCursor
20 from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QApplication, QLineEdit 20 from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QApplication, QLineEdit
21 21
22 from E5Gui.E5Application import e5App 22 from E5Gui.E5Application import e5App
23 from E5Gui import E5MessageBox 23 from E5Gui import E5MessageBox
330 parents = self.__getParents(rev) 330 parents = self.__getParents(rev)
331 for parent in parents: 331 for parent in parents:
332 url = QUrl() 332 url = QUrl()
333 url.setScheme("file") 333 url.setScheme("file")
334 url.setPath(self.filename) 334 url.setPath(self.filename)
335 query = QByteArray() 335 query = parent.split(":")[0] + '_' + rev
336 query.append(parent.split(":")[0]).append('_').append(rev) 336 url.setQuery(query)
337 url.setEncodedQuery(query)
338 dstr += ' [<a href="{0}" name="{1}" id="{1}">{2}</a>]'.format( 337 dstr += ' [<a href="{0}" name="{1}" id="{1}">{2}</a>]'.format(
339 url.toString(), 338 url.toString(), query,
340 str(query, encoding="ascii"),
341 self.tr('diff to {0}').format(parent), 339 self.tr('diff to {0}').format(parent),
342 ) 340 )
343 dstr += '<br />\n' 341 dstr += '<br />\n'
344 html += dstr 342 html += dstr
345 343
479 """ 477 """
480 filename = url.path() 478 filename = url.path()
481 if Utilities.isWindowsPlatform(): 479 if Utilities.isWindowsPlatform():
482 if filename.startswith("/"): 480 if filename.startswith("/"):
483 filename = filename[1:] 481 filename = filename[1:]
484 ver = bytes(url.encodedQuery()).decode() 482 ver = url.query()
485 v1, v2 = ver.split('_') 483 v1, v2 = ver.split('_')
486 if v1 == "" or v2 == "": 484 if v1 == "" or v2 == "":
487 return 485 return
488 self.contents.scrollToAnchor(ver) 486 self.contents.scrollToAnchor(ver)
489 487

eric ide

mercurial