12 import os |
12 import os |
13 import sys |
13 import sys |
14 |
14 |
15 import pysvn |
15 import pysvn |
16 |
16 |
17 from PyQt5.QtCore import QMutexLocker, QByteArray, QUrl, Qt |
17 from PyQt5.QtCore import QMutexLocker, QUrl, Qt |
18 from PyQt5.QtGui import QCursor, QTextCursor |
18 from PyQt5.QtGui import QCursor, QTextCursor |
19 from PyQt5.QtWidgets import QWidget, QApplication, QDialogButtonBox |
19 from PyQt5.QtWidgets import QWidget, QApplication, QDialogButtonBox |
20 |
20 |
21 from .SvnUtilities import formatTime |
21 from .SvnUtilities import formatTime |
22 |
22 |
138 lv = "{0:d}".format( |
138 lv = "{0:d}".format( |
139 logs[logs.index(log) + 1]["revision"].number) |
139 logs[logs.index(log) + 1]["revision"].number) |
140 url = QUrl() |
140 url = QUrl() |
141 url.setScheme("file") |
141 url.setScheme("file") |
142 url.setPath(self.filename) |
142 url.setPath(self.filename) |
143 query = QByteArray() |
143 query = lv + '_' + ver |
144 query.append(lv).append('_').append(ver) |
144 url.setQuery(query) |
145 url.setEncodedQuery(query) |
|
146 dstr += ' [<a href="{0}" name="{1}">{2}</a>]'.format( |
145 dstr += ' [<a href="{0}" name="{1}">{2}</a>]'.format( |
147 url.toString(), query, |
146 url.toString(), query, |
148 self.tr('diff to {0}').format(lv) |
147 self.tr('diff to {0}').format(lv) |
149 ) |
148 ) |
150 except IndexError: |
149 except IndexError: |
235 self.contents.setSource(QUrl('')) |
234 self.contents.setSource(QUrl('')) |
236 filename = url.path() |
235 filename = url.path() |
237 if Utilities.isWindowsPlatform(): |
236 if Utilities.isWindowsPlatform(): |
238 if filename.startswith("/"): |
237 if filename.startswith("/"): |
239 filename = filename[1:] |
238 filename = filename[1:] |
240 ver = bytes(url.encodedQuery()).decode() |
239 ver = url.query() |
241 v1 = ver.split('_')[0] |
240 v1 = ver.split('_')[0] |
242 v2 = ver.split('_')[1] |
241 v2 = ver.split('_')[1] |
243 if not v1 or not v2: |
242 if not v1 or not v2: |
244 return |
243 return |
245 try: |
244 try: |