Plugins/VcsPlugins/vcsPySvn/subversion.py

changeset 1888
03f59d88a62d
parent 1883
2de804dc1452
child 1890
6523d664e754
equal deleted inserted replaced
1886:732f94385668 1888:03f59d88a62d
45 from .SvnBlameDialog import SvnBlameDialog 45 from .SvnBlameDialog import SvnBlameDialog
46 from .SvnInfoDialog import SvnInfoDialog 46 from .SvnInfoDialog import SvnInfoDialog
47 from .SvnRelocateDialog import SvnRelocateDialog 47 from .SvnRelocateDialog import SvnRelocateDialog
48 from .SvnUrlSelectionDialog import SvnUrlSelectionDialog 48 from .SvnUrlSelectionDialog import SvnUrlSelectionDialog
49 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog 49 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
50 from .SvnChangeListsDialog import SvnChangeListsDialog
50 from .SvnStatusMonitorThread import SvnStatusMonitorThread 51 from .SvnStatusMonitorThread import SvnStatusMonitorThread
51 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig 52 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig
52 53
53 from .ProjectBrowserHelper import SvnProjectBrowserHelper 54 from .ProjectBrowserHelper import SvnProjectBrowserHelper
54 55
471 @param noDialog flag indicating quiet operations 472 @param noDialog flag indicating quiet operations
472 """ 473 """
473 if not noDialog and not message: 474 if not noDialog and not message:
474 # call CommitDialog and get message from there 475 # call CommitDialog and get message from there
475 if self.__commitDialog is None: 476 if self.__commitDialog is None:
476 self.__commitDialog = SvnCommitDialog(self.__ui) 477 self.__commitDialog = SvnCommitDialog(self.svnGetChangelists(), self.__ui)
477 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) 478 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2)
478 self.__commitDialog.show() 479 self.__commitDialog.show()
479 self.__commitDialog.raise_() 480 self.__commitDialog.raise_()
480 self.__commitDialog.activateWindow() 481 self.__commitDialog.activateWindow()
481 482
2147 (string) 2148 (string)
2148 """ 2149 """
2149 if not isinstance(names, list): 2150 if not isinstance(names, list):
2150 names = [names] 2151 names = [names]
2151 2152
2152 clname, ok = QInputDialog.getText( 2153 clname, ok = QInputDialog.getItem(
2153 None, 2154 None,
2154 self.trUtf8("Add to changelist"), 2155 self.trUtf8("Add to changelist"),
2155 self.trUtf8("Enter name of the changelist:"), 2156 self.trUtf8("Enter name of the changelist:"),
2156 QLineEdit.Normal) 2157 sorted(self.svnGetChangelists()),
2158 0, True)
2157 if not ok or not clname: 2159 if not ok or not clname:
2158 return 2160 return
2159 2161
2160 client = self.getClient() 2162 client = self.getClient()
2161 dlg = \ 2163 dlg = \
2171 dlg.showError(e.args[0]) 2173 dlg.showError(e.args[0])
2172 locker.unlock() 2174 locker.unlock()
2173 dlg.finish() 2175 dlg.finish()
2174 dlg.exec_() 2176 dlg.exec_()
2175 2177
2176 # TODO: add a svnShowChangelists method to show the changelists 2178 def svnShowChangelists(self, path):
2177 # TODO: add a svnGetChangelists method returning the changelists and their associated files 2179 """
2180 Public method used to inspect the change lists defined for the project.
2181
2182 @param path directory name to show change lists for (string)
2183 """
2184 self.changeLists = SvnChangeListsDialog(self)
2185 self.changeLists.show()
2186 QApplication.processEvents()
2187 self.changeLists.start(path)
2188
2189 def svnGetChangelists(self):
2190 """
2191 Public method to get a list of all defined change lists.
2192
2193 @return list of defined change list names (list of strings)
2194 """
2195 changelists = []
2196 client = self.getClient()
2197 if hasattr(client, 'get_changelist'):
2198 ppath = e5App().getObject("Project").getProjectPath()
2199 locker = QMutexLocker(self.vcsExecutionMutex)
2200 try:
2201 entries = client.get_changelist(ppath, depth=pysvn.depth.infinity)
2202 for entry in entries:
2203 changelist = entry[1]
2204 if changelist not in changelists:
2205 changelists.append(changelist)
2206 except pysvn.ClientError:
2207 pass
2208 locker.unlock()
2209
2210 return changelists
2178 2211
2179 ############################################################################ 2212 ############################################################################
2180 ## Private Subversion specific methods are below. 2213 ## Private Subversion specific methods are below.
2181 ############################################################################ 2214 ############################################################################
2182 2215

eric ide

mercurial