eric6/Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py

changeset 7260
4cc6f121119a
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7259:7c017076c12e 7260:4cc6f121119a
10 10
11 import pysvn 11 import pysvn
12 12
13 from PyQt5.QtCore import QMutexLocker, Qt, pyqtSlot 13 from PyQt5.QtCore import QMutexLocker, Qt, pyqtSlot
14 from PyQt5.QtGui import QCursor 14 from PyQt5.QtGui import QCursor
15 from PyQt5.QtWidgets import QHeaderView, QDialog, QApplication, \ 15 from PyQt5.QtWidgets import (
16 QDialogButtonBox, QTreeWidgetItem 16 QHeaderView, QDialog, QApplication, QDialogButtonBox, QTreeWidgetItem
17 )
17 18
18 from E5Gui import E5MessageBox 19 from E5Gui import E5MessageBox
19 20
20 from .SvnUtilities import formatTime 21 from .SvnUtilities import formatTime
21 from .SvnDialogMixin import SvnDialogMixin 22 from .SvnDialogMixin import SvnDialogMixin
60 61
61 self.__urlRole = Qt.UserRole 62 self.__urlRole = Qt.UserRole
62 self.__ignoreExpand = False 63 self.__ignoreExpand = False
63 64
64 self.client = self.vcs.getClient() 65 self.client = self.vcs.getClient()
65 self.client.callback_cancel = \ 66 self.client.callback_cancel = self._clientCancelCallback
66 self._clientCancelCallback 67 self.client.callback_get_login = self._clientLoginCallback
67 self.client.callback_get_login = \ 68 self.client.callback_ssl_server_trust_prompt = (
68 self._clientLoginCallback
69 self.client.callback_ssl_server_trust_prompt = \
70 self._clientSslServerTrustPromptCallback 69 self._clientSslServerTrustPromptCallback
70 )
71 71
72 self.show() 72 self.show()
73 QApplication.processEvents() 73 QApplication.processEvents()
74 74
75 def __resort(self): 75 def __resort(self):
162 try: 162 try:
163 entries = self.client.list(url, recurse=False) 163 entries = self.client.list(url, recurse=False)
164 firstTime = parent == self.repoTree 164 firstTime = parent == self.repoTree
165 # dirent elements are all unicode in Python 2 165 # dirent elements are all unicode in Python 2
166 for dirent, _lock in entries: 166 for dirent, _lock in entries:
167 if (firstTime and dirent["path"] != url) or \ 167 if (
168 (parent != self.repoTree and dirent["path"] == url): 168 (firstTime and dirent["path"] != url) or
169 (parent != self.repoTree and dirent["path"] == url)
170 ):
169 continue 171 continue
170 if firstTime: 172 if firstTime:
171 if dirent["repos_path"] != "/": 173 if dirent["repos_path"] != "/":
172 repoUrl = dirent["path"].replace( 174 repoUrl = dirent["path"].replace(
173 dirent["repos_path"], "") 175 dirent["repos_path"], "")
179 parent, "/", "", "", 0, "", 181 parent, "/", "", "", 0, "",
180 pysvn.node_kind.dir, repoUrl) 182 pysvn.node_kind.dir, repoUrl)
181 itm.setExpanded(True) 183 itm.setExpanded(True)
182 parent = itm 184 parent = itm
183 urlPart = repoUrl 185 urlPart = repoUrl
184 for element in \ 186 for element in (
185 dirent["repos_path"].split("/")[:-1]: 187 dirent["repos_path"].split("/")[:-1]
188 ):
186 if element: 189 if element:
187 urlPart = "{0}/{1}".format(urlPart, 190 urlPart = "{0}/{1}".format(urlPart,
188 element) 191 element)
189 itm = self.__generateItem( 192 itm = self.__generateItem(
190 parent, element, "", "", 0, "", 193 parent, element, "", "", 0, "",

eric ide

mercurial