8 """ |
8 """ |
9 |
9 |
10 import pysvn |
10 import pysvn |
11 |
11 |
12 from PyQt4.QtCore import QMutexLocker, Qt, pyqtSlot |
12 from PyQt4.QtCore import QMutexLocker, Qt, pyqtSlot |
13 from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, QDialogButtonBox, \ |
13 from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, \ |
14 QTreeWidgetItem |
14 QDialogButtonBox, QTreeWidgetItem |
15 |
15 |
16 from E5Gui import E5MessageBox |
16 from E5Gui import E5MessageBox |
17 |
17 |
18 from .SvnUtilities import formatTime |
18 from .SvnUtilities import formatTime |
19 from .SvnDialogMixin import SvnDialogMixin |
19 from .SvnDialogMixin import SvnDialogMixin |
86 def __generateItem(self, parent, repopath, revision, author, size, date, |
86 def __generateItem(self, parent, repopath, revision, author, size, date, |
87 nodekind, url): |
87 nodekind, url): |
88 """ |
88 """ |
89 Private method to generate a tree item in the repository tree. |
89 Private method to generate a tree item in the repository tree. |
90 |
90 |
91 @param parent parent of the item to be created (QTreeWidget or QTreeWidgetItem) |
91 @param parent parent of the item to be created (QTreeWidget or |
|
92 QTreeWidgetItem) |
92 @param repopath path of the item (string) |
93 @param repopath path of the item (string) |
93 @param revision revision info (string or pysvn.opt_revision_kind) |
94 @param revision revision info (string or pysvn.opt_revision_kind) |
94 @param author author info (string) |
95 @param author author info (string) |
95 @param size size info (integer) |
96 @param size size info (integer) |
96 @param date date info (integer) |
97 @param date date info (integer) |
161 if (firstTime and dirent["path"] != url) or \ |
162 if (firstTime and dirent["path"] != url) or \ |
162 (parent != self.repoTree and dirent["path"] == url): |
163 (parent != self.repoTree and dirent["path"] == url): |
163 continue |
164 continue |
164 if firstTime: |
165 if firstTime: |
165 if dirent["repos_path"] != "/": |
166 if dirent["repos_path"] != "/": |
166 repoUrl = dirent["path"].replace(dirent["repos_path"], "") |
167 repoUrl = dirent["path"].replace( |
|
168 dirent["repos_path"], "") |
167 else: |
169 else: |
168 repoUrl = dirent["path"] |
170 repoUrl = dirent["path"] |
169 if repoUrl != url: |
171 if repoUrl != url: |
170 self.__ignoreExpand = True |
172 self.__ignoreExpand = True |
171 itm = self.__generateItem(parent, "/", |
173 itm = self.__generateItem(parent, "/", |
172 "", "", 0, "", pysvn.node_kind.dir, repoUrl) |
174 "", "", 0, "", pysvn.node_kind.dir, repoUrl) |
173 itm.setExpanded(True) |
175 itm.setExpanded(True) |
174 parent = itm |
176 parent = itm |
175 urlPart = repoUrl |
177 urlPart = repoUrl |
176 for element in dirent["repos_path"].split("/")[:-1]: |
178 for element in \ |
|
179 dirent["repos_path"].split("/")[:-1]: |
177 if element: |
180 if element: |
178 urlPart = "{0}/{1}".format(urlPart, element) |
181 urlPart = "{0}/{1}".format(urlPart, |
|
182 element) |
179 itm = self.__generateItem(parent, element, |
183 itm = self.__generateItem(parent, element, |
180 "", "", 0, "", pysvn.node_kind.dir, |
184 "", "", 0, "", pysvn.node_kind.dir, |
181 urlPart) |
185 urlPart) |
182 itm.setExpanded(True) |
186 itm.setExpanded(True) |
183 parent = itm |
187 parent = itm |