Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3009
bf5ae5d7477d
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 11
12 import pysvn 12 import pysvn
13 13
14 from PyQt4.QtCore import QMutexLocker, Qt, pyqtSlot 14 from PyQt4.QtCore import QMutexLocker, Qt, pyqtSlot
15 from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, QDialogButtonBox, \ 15 from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, \
16 QTreeWidgetItem 16 QDialogButtonBox, QTreeWidgetItem
17 17
18 from E5Gui import E5MessageBox 18 from E5Gui import E5MessageBox
19 19
20 from .SvnUtilities import formatTime 20 from .SvnUtilities import formatTime
21 from .SvnDialogMixin import SvnDialogMixin 21 from .SvnDialogMixin import SvnDialogMixin
88 def __generateItem(self, parent, repopath, revision, author, size, date, 88 def __generateItem(self, parent, repopath, revision, author, size, date,
89 nodekind, url): 89 nodekind, url):
90 """ 90 """
91 Private method to generate a tree item in the repository tree. 91 Private method to generate a tree item in the repository tree.
92 92
93 @param parent parent of the item to be created (QTreeWidget or QTreeWidgetItem) 93 @param parent parent of the item to be created (QTreeWidget or
94 QTreeWidgetItem)
94 @param repopath path of the item (string) 95 @param repopath path of the item (string)
95 @param revision revision info (string or pysvn.opt_revision_kind) 96 @param revision revision info (string or pysvn.opt_revision_kind)
96 @param author author info (string) 97 @param author author info (string)
97 @param size size info (integer) 98 @param size size info (integer)
98 @param date date info (integer) 99 @param date date info (integer)
163 if (firstTime and dirent["path"] != url) or \ 164 if (firstTime and dirent["path"] != url) or \
164 (parent != self.repoTree and dirent["path"] == url): 165 (parent != self.repoTree and dirent["path"] == url):
165 continue 166 continue
166 if firstTime: 167 if firstTime:
167 if dirent["repos_path"] != "/": 168 if dirent["repos_path"] != "/":
168 repoUrl = dirent["path"].replace(dirent["repos_path"], "") 169 repoUrl = dirent["path"].replace(
170 dirent["repos_path"], "")
169 else: 171 else:
170 repoUrl = dirent["path"] 172 repoUrl = dirent["path"]
171 if repoUrl != url: 173 if repoUrl != url:
172 self.__ignoreExpand = True 174 self.__ignoreExpand = True
173 itm = self.__generateItem(parent, "/", 175 itm = self.__generateItem(parent, "/",
174 "", "", 0, "", pysvn.node_kind.dir, repoUrl) 176 "", "", 0, "", pysvn.node_kind.dir, repoUrl)
175 itm.setExpanded(True) 177 itm.setExpanded(True)
176 parent = itm 178 parent = itm
177 urlPart = repoUrl 179 urlPart = repoUrl
178 for element in dirent["repos_path"].split("/")[:-1]: 180 for element in \
181 dirent["repos_path"].split("/")[:-1]:
179 if element: 182 if element:
180 urlPart = "{0}/{1}".format(urlPart, element) 183 urlPart = "{0}/{1}".format(urlPart,
184 element)
181 itm = self.__generateItem(parent, element, 185 itm = self.__generateItem(parent, element,
182 "", "", 0, "", pysvn.node_kind.dir, 186 "", "", 0, "", pysvn.node_kind.dir,
183 urlPart) 187 urlPart)
184 itm.setExpanded(True) 188 itm.setExpanded(True)
185 parent = itm 189 parent = itm

eric ide

mercurial