src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py

branch
eric7
changeset 11006
a671918232f3
parent 10683
779cda568acb
child 11090
f5f5f5803935
equal deleted inserted replaced
11005:b918c6c2736b 11006:a671918232f3
320 self.tr("Importing project into Subversion repository"), 320 self.tr("Importing project into Subversion repository"),
321 "import{0} --message {1} .".format( 321 "import{0} --message {1} .".format(
322 (not recurse) and " --non-recursive" or "", msg 322 (not recurse) and " --non-recursive" or "", msg
323 ), 323 ),
324 client, 324 client,
325 parent=self.__ui,
325 ) 326 )
326 QApplication.processEvents() 327 QApplication.processEvents()
327 try: 328 try:
328 with EricMutexLocker(self.vcsExecutionMutex): 329 with EricMutexLocker(self.vcsExecutionMutex):
329 rev = client.import_(".", url, msg, recurse, ignore=True) 330 rev = client.import_(".", url, msg, recurse, ignore=True)
402 self.tr("Checking project out of Subversion repository"), 403 self.tr("Checking project out of Subversion repository"),
403 "checkout{0} {1} {2}".format( 404 "checkout{0} {1} {2}".format(
404 (not recurse) and " --non-recursive" or "", url, projectDir 405 (not recurse) and " --non-recursive" or "", url, projectDir
405 ), 406 ),
406 client, 407 client,
408 parent=self.__ui,
407 ) 409 )
408 QApplication.processEvents() 410 QApplication.processEvents()
409 try: 411 try:
410 with EricMutexLocker(self.vcsExecutionMutex): 412 with EricMutexLocker(self.vcsExecutionMutex):
411 client.checkout(url, projectDir, recurse) 413 client.checkout(url, projectDir, recurse)
471 self.tr("Exporting project from Subversion repository"), 473 self.tr("Exporting project from Subversion repository"),
472 "export --force{0} {1} {2}".format( 474 "export --force{0} {1} {2}".format(
473 (not recurse) and " --non-recursive" or "", url, projectDir 475 (not recurse) and " --non-recursive" or "", url, projectDir
474 ), 476 ),
475 client, 477 client,
478 parent=self.__ui,
476 ) 479 )
477 QApplication.processEvents() 480 QApplication.processEvents()
478 try: 481 try:
479 with EricMutexLocker(self.vcsExecutionMutex): 482 with EricMutexLocker(self.vcsExecutionMutex):
480 client.export(url, projectDir, force=True, recurse=recurse) 483 client.export(url, projectDir, force=True, recurse=recurse)
602 changelists and " --changelist ".join([""] + changelists) or "", 605 changelists and " --changelist ".join([""] + changelists) or "",
603 msg, 606 msg,
604 " ".join(fnames), 607 " ".join(fnames),
605 ), 608 ),
606 client, 609 client,
610 parent=self.__ui,
607 ) 611 )
608 QApplication.processEvents() 612 QApplication.processEvents()
609 try: 613 try:
610 with EricMutexLocker(self.vcsExecutionMutex): 614 with EricMutexLocker(self.vcsExecutionMutex):
611 rev = ( 615 rev = (
702 self.tr("Synchronizing with the Subversion repository"), 706 self.tr("Synchronizing with the Subversion repository"),
703 "update{0} {1}".format( 707 "update{0} {1}".format(
704 (not recurse) and " --non-recursive" or "", " ".join(fnames) 708 (not recurse) and " --non-recursive" or "", " ".join(fnames)
705 ), 709 ),
706 client, 710 client,
711 parent=self.__ui,
707 ) 712 )
708 QApplication.processEvents() 713 QApplication.processEvents()
709 try: 714 try:
710 with EricMutexLocker(self.vcsExecutionMutex): 715 with EricMutexLocker(self.vcsExecutionMutex):
711 client.update(fnames, recurse) 716 client.update(fnames, recurse)
818 force and " --force" or "", 823 force and " --force" or "",
819 noignore and " --no-ignore" or "", 824 noignore and " --no-ignore" or "",
820 " ".join(names), 825 " ".join(names),
821 ), 826 ),
822 client, 827 client,
828 parent=self.__ui,
823 ) 829 )
824 QApplication.processEvents() 830 QApplication.processEvents()
825 try: 831 try:
826 with EricMutexLocker(self.vcsExecutionMutex): 832 with EricMutexLocker(self.vcsExecutionMutex):
827 client.add(names, recurse=recurse, force=force, ignore=not noignore) 833 client.add(names, recurse=recurse, force=force, ignore=not noignore)
929 force and " --force" or "", 935 force and " --force" or "",
930 ignore and " --ignore" or "", 936 ignore and " --ignore" or "",
931 " ".join(names), 937 " ".join(names),
932 ), 938 ),
933 client, 939 client,
940 parent=self.__ui,
934 ) 941 )
935 QApplication.processEvents() 942 QApplication.processEvents()
936 try: 943 try:
937 with EricMutexLocker(self.vcsExecutionMutex): 944 with EricMutexLocker(self.vcsExecutionMutex):
938 client.add(names, recurse=recurse, force=force, ignore=ignore) 945 client.add(names, recurse=recurse, force=force, ignore=ignore)
966 if not noDialog: 973 if not noDialog:
967 dlg = SvnDialog( 974 dlg = SvnDialog(
968 self.tr("Removing files/directories from the Subversion repository"), 975 self.tr("Removing files/directories from the Subversion repository"),
969 "remove{0} {1}".format(force and " --force" or "", " ".join(name)), 976 "remove{0} {1}".format(force and " --force" or "", " ".join(name)),
970 client, 977 client,
978 parent=self.__ui,
971 ) 979 )
972 QApplication.processEvents() 980 QApplication.processEvents()
973 try: 981 try:
974 with EricMutexLocker(self.vcsExecutionMutex): 982 with EricMutexLocker(self.vcsExecutionMutex):
975 client.remove(name, force=force) 983 client.remove(name, force=force)
1009 if target is None: 1017 if target is None:
1010 return False 1018 return False
1011 force = True 1019 force = True
1012 accepted = True 1020 accepted = True
1013 else: 1021 else:
1014 dlg = SvnCopyDialog(name, None, True, "--force" in opts) 1022 dlg = SvnCopyDialog(
1023 name, parent=self.__ui, move=True, force="--force" in opts
1024 )
1015 accepted = dlg.exec() == QDialog.DialogCode.Accepted 1025 accepted = dlg.exec() == QDialog.DialogCode.Accepted
1016 if accepted: 1026 if accepted:
1017 target, force = dlg.getData() 1027 target, force = dlg.getData()
1018 if not target: 1028 if not target:
1019 return False 1029 return False
1035 log and (" --message {0}".format(log)) or "", 1045 log and (" --message {0}".format(log)) or "",
1036 name, 1046 name,
1037 target, 1047 target,
1038 ), 1048 ),
1039 client, 1049 client,
1050 parent=self.__ui,
1040 log=log, 1051 log=log,
1041 ) 1052 )
1042 QApplication.processEvents() 1053 QApplication.processEvents()
1043 try: 1054 try:
1044 with EricMutexLocker(self.vcsExecutionMutex): 1055 with EricMutexLocker(self.vcsExecutionMutex):
1140 1151
1141 url = ( 1152 url = (
1142 None if self.otherData["standardLayout"] else self.svnNormalizeURL(reposURL) 1153 None if self.otherData["standardLayout"] else self.svnNormalizeURL(reposURL)
1143 ) 1154 )
1144 dlg = SvnTagDialog( 1155 dlg = SvnTagDialog(
1145 self.allTagsBranchesList, url, self.otherData["standardLayout"] 1156 self.allTagsBranchesList,
1157 url,
1158 self.otherData["standardLayout"],
1159 parent=self.__ui,
1146 ) 1160 )
1147 if dlg.exec() == QDialog.DialogCode.Accepted: 1161 if dlg.exec() == QDialog.DialogCode.Accepted:
1148 tag, tagOp = dlg.getParameters() 1162 tag, tagOp = dlg.getParameters()
1149 if tag in self.allTagsBranchesList: 1163 if tag in self.allTagsBranchesList:
1150 self.allTagsBranchesList.remove(tag) 1164 self.allTagsBranchesList.remove(tag)
1183 log = "Created tag <{0}>".format(self.tagName) 1197 log = "Created tag <{0}>".format(self.tagName)
1184 dlg = SvnDialog( 1198 dlg = SvnDialog(
1185 self.tr("Tagging {0} in the Subversion repository").format(name), 1199 self.tr("Tagging {0} in the Subversion repository").format(name),
1186 "copy --message {0} {1} {2}".format(log, reposURL, url), 1200 "copy --message {0} {1} {2}".format(log, reposURL, url),
1187 client, 1201 client,
1202 parent=self.__ui,
1188 log=log, 1203 log=log,
1189 ) 1204 )
1190 QApplication.processEvents() 1205 QApplication.processEvents()
1191 try: 1206 try:
1192 with EricMutexLocker(self.vcsExecutionMutex): 1207 with EricMutexLocker(self.vcsExecutionMutex):
1197 log = "Deleted tag <{0}>".format(self.tagName) 1212 log = "Deleted tag <{0}>".format(self.tagName)
1198 dlg = SvnDialog( 1213 dlg = SvnDialog(
1199 self.tr("Tagging {0} in the Subversion repository").format(name), 1214 self.tr("Tagging {0} in the Subversion repository").format(name),
1200 "remove --message {0} {1}".format(log, url), 1215 "remove --message {0} {1}".format(log, url),
1201 client, 1216 client,
1217 parent=self.__ui,
1202 log=log, 1218 log=log,
1203 ) 1219 )
1204 QApplication.processEvents() 1220 QApplication.processEvents()
1205 try: 1221 try:
1206 with EricMutexLocker(self.vcsExecutionMutex): 1222 with EricMutexLocker(self.vcsExecutionMutex):
1255 self.tr("Reverting changes"), 1271 self.tr("Reverting changes"),
1256 "revert {0} {1}".format( 1272 "revert {0} {1}".format(
1257 (not recurse) and " --non-recursive" or "", " ".join(name) 1273 (not recurse) and " --non-recursive" or "", " ".join(name)
1258 ), 1274 ),
1259 client, 1275 client,
1276 parent=self.__ui,
1260 ) 1277 )
1261 QApplication.processEvents() 1278 QApplication.processEvents()
1262 try: 1279 try:
1263 with EricMutexLocker(self.vcsExecutionMutex): 1280 with EricMutexLocker(self.vcsExecutionMutex):
1264 client.revert(name, recurse) 1281 client.revert(name, recurse)
1310 1327
1311 url = ( 1328 url = (
1312 None if self.otherData["standardLayout"] else self.svnNormalizeURL(reposURL) 1329 None if self.otherData["standardLayout"] else self.svnNormalizeURL(reposURL)
1313 ) 1330 )
1314 dlg = SvnSwitchDialog( 1331 dlg = SvnSwitchDialog(
1315 self.allTagsBranchesList, url, self.otherData["standardLayout"] 1332 self.allTagsBranchesList,
1333 url,
1334 self.otherData["standardLayout"],
1335 parent=self.__ui,
1316 ) 1336 )
1317 if dlg.exec() == QDialog.DialogCode.Accepted: 1337 if dlg.exec() == QDialog.DialogCode.Accepted:
1318 tag, tagType = dlg.getParameters() 1338 tag, tagType = dlg.getParameters()
1319 if tag in self.allTagsBranchesList: 1339 if tag in self.allTagsBranchesList:
1320 self.allTagsBranchesList.remove(tag) 1340 self.allTagsBranchesList.remove(tag)
1353 client = self.getClient() 1373 client = self.getClient()
1354 dlg = SvnDialog( 1374 dlg = SvnDialog(
1355 self.tr("Switching to {0}").format(tn), 1375 self.tr("Switching to {0}").format(tn),
1356 "switch {0} {1}".format(url, name), 1376 "switch {0} {1}".format(url, name),
1357 client, 1377 client,
1378 parent=self.__ui,
1358 ) 1379 )
1359 QApplication.processEvents() 1380 QApplication.processEvents()
1360 try: 1381 try:
1361 with EricMutexLocker(self.vcsExecutionMutex): 1382 with EricMutexLocker(self.vcsExecutionMutex):
1362 rev = client.switch(name, url) 1383 rev = client.switch(name, url)
1380 1401
1381 dname, fname = self.splitPath(name) 1402 dname, fname = self.splitPath(name)
1382 1403
1383 opts = self.options["global"] 1404 opts = self.options["global"]
1384 dlg = SvnMergeDialog( 1405 dlg = SvnMergeDialog(
1385 self.mergeList[0], self.mergeList[1], self.mergeList[2], "--force" in opts 1406 self.mergeList[0],
1407 self.mergeList[1],
1408 self.mergeList[2],
1409 "--force" in opts,
1410 parent=self.__ui,
1386 ) 1411 )
1387 if dlg.exec() == QDialog.DialogCode.Accepted: 1412 if dlg.exec() == QDialog.DialogCode.Accepted:
1388 urlrev1, urlrev2, target, force = dlg.getParameters() 1413 urlrev1, urlrev2, target, force = dlg.getParameters()
1389 else: 1414 else:
1390 return 1415 return
1460 "{0}{1}".format(url1, rev1 and ("@" + rev1) or ""), 1485 "{0}{1}".format(url1, rev1 and ("@" + rev1) or ""),
1461 "{0}{1}".format(url2, rev2 and ("@" + rev2) or ""), 1486 "{0}{1}".format(url2, rev2 and ("@" + rev2) or ""),
1462 fname, 1487 fname,
1463 ), 1488 ),
1464 client, 1489 client,
1490 parent=self.__ui,
1465 ) 1491 )
1466 QApplication.processEvents() 1492 QApplication.processEvents()
1467 try: 1493 try:
1468 with EricMutexLocker(self.vcsExecutionMutex): 1494 with EricMutexLocker(self.vcsExecutionMutex):
1469 client.merge( 1495 client.merge(
1782 @param name directory name to be cleaned up 1808 @param name directory name to be cleaned up
1783 @type str 1809 @type str
1784 """ 1810 """
1785 client = self.getClient() 1811 client = self.getClient()
1786 dlg = SvnDialog( 1812 dlg = SvnDialog(
1787 self.tr("Cleaning up {0}").format(name), "cleanup {0}".format(name), client 1813 self.tr("Cleaning up {0}").format(name),
1814 "cleanup {0}".format(name),
1815 client,
1816 parent=self.__ui,
1788 ) 1817 )
1789 QApplication.processEvents() 1818 QApplication.processEvents()
1790 try: 1819 try:
1791 with EricMutexLocker(self.vcsExecutionMutex): 1820 with EricMutexLocker(self.vcsExecutionMutex):
1792 client.cleanup(name) 1821 client.cleanup(name)
1806 SvnDialog as SvnProcessDialog, 1835 SvnDialog as SvnProcessDialog,
1807 ) 1836 )
1808 1837
1809 from .SvnCommandDialog import SvnCommandDialog 1838 from .SvnCommandDialog import SvnCommandDialog
1810 1839
1811 dlg = SvnCommandDialog(self.commandHistory, self.wdHistory, name) 1840 dlg = SvnCommandDialog(
1841 self.commandHistory, self.wdHistory, name, parent=self.__ui
1842 )
1812 if dlg.exec() == QDialog.DialogCode.Accepted: 1843 if dlg.exec() == QDialog.DialogCode.Accepted:
1813 command, wd = dlg.getData() 1844 command, wd = dlg.getData()
1814 commandList = Utilities.parseOptionString(command) 1845 commandList = Utilities.parseOptionString(command)
1815 1846
1816 # This moves any previous occurrence of these arguments to the head 1847 # This moves any previous occurrence of these arguments to the head
1823 self.wdHistory.insert(0, wd) 1854 self.wdHistory.insert(0, wd)
1824 1855
1825 args = [] 1856 args = []
1826 self.addArguments(args, commandList) 1857 self.addArguments(args, commandList)
1827 1858
1828 dia = SvnProcessDialog(self.tr("Subversion command")) 1859 dia = SvnProcessDialog(self.tr("Subversion command"), parent=self.__ui)
1829 res = dia.startProcess(args, wd) 1860 res = dia.startProcess(args, wd)
1830 if res: 1861 if res:
1831 dia.exec() 1862 dia.exec()
1832 1863
1833 def vcsOptionsDialog( 1864 def vcsOptionsDialog(
1960 self.tr("Resolving conficts"), 1991 self.tr("Resolving conficts"),
1961 "resolved{0} {1}".format( 1992 "resolved{0} {1}".format(
1962 (not recurse) and " --non-recursive" or "", " ".join(fnames) 1993 (not recurse) and " --non-recursive" or "", " ".join(fnames)
1963 ), 1994 ),
1964 client, 1995 client,
1996 parent=self.__ui,
1965 ) 1997 )
1966 QApplication.processEvents() 1998 QApplication.processEvents()
1967 try: 1999 try:
1968 with EricMutexLocker(self.vcsExecutionMutex): 2000 with EricMutexLocker(self.vcsExecutionMutex):
1969 for name in fnames: 2001 for name in fnames:
1987 @rtype bool 2019 @rtype bool
1988 """ 2020 """
1989 from .SvnCopyDialog import SvnCopyDialog 2021 from .SvnCopyDialog import SvnCopyDialog
1990 2022
1991 rx_prot = re.compile("(file:|svn:|svn+ssh:|http:|https:).+") 2023 rx_prot = re.compile("(file:|svn:|svn+ssh:|http:|https:).+")
1992 dlg = SvnCopyDialog(name) 2024 dlg = SvnCopyDialog(name, parent=self.__ui)
1993 res = False 2025 res = False
1994 if dlg.exec() == QDialog.DialogCode.Accepted: 2026 if dlg.exec() == QDialog.DialogCode.Accepted:
1995 target, force = dlg.getData() 2027 target, force = dlg.getData()
1996 2028
1997 client = self.getClient() 2029 client = self.getClient()
2004 self.tr("Copying {0}").format(name), 2036 self.tr("Copying {0}").format(name),
2005 "copy{0} {1} {2}".format( 2037 "copy{0} {1} {2}".format(
2006 log and (" --message {0}".format(log)) or "", name, target 2038 log and (" --message {0}".format(log)) or "", name, target
2007 ), 2039 ),
2008 client, 2040 client,
2041 parent=self.__ui,
2009 log=log, 2042 log=log,
2010 ) 2043 )
2011 QApplication.processEvents() 2044 QApplication.processEvents()
2012 try: 2045 try:
2013 with EricMutexLocker(self.vcsExecutionMutex): 2046 with EricMutexLocker(self.vcsExecutionMutex):
2056 @param recursive flag indicating a recursive set is requested 2089 @param recursive flag indicating a recursive set is requested
2057 @type bool 2090 @type bool
2058 """ 2091 """
2059 from .SvnPropSetDialog import SvnPropSetDialog 2092 from .SvnPropSetDialog import SvnPropSetDialog
2060 2093
2061 dlg = SvnPropSetDialog(recursive) 2094 dlg = SvnPropSetDialog(recursive, parent=self.__ui)
2062 if dlg.exec() == QDialog.DialogCode.Accepted: 2095 if dlg.exec() == QDialog.DialogCode.Accepted:
2063 propName, propValue, recurse = dlg.getData() 2096 propName, propValue, recurse = dlg.getData()
2064 if not propName: 2097 if not propName:
2065 EricMessageBox.critical( 2098 EricMessageBox.critical(
2066 self.__ui, 2099 self.__ui,
2088 propName, 2121 propName,
2089 propValue, 2122 propValue,
2090 " ".join(fnames), 2123 " ".join(fnames),
2091 ), 2124 ),
2092 client, 2125 client,
2126 parent=self.__ui,
2093 ) 2127 )
2094 QApplication.processEvents() 2128 QApplication.processEvents()
2095 try: 2129 try:
2096 with EricMutexLocker(self.vcsExecutionMutex): 2130 with EricMutexLocker(self.vcsExecutionMutex):
2097 for name in fnames: 2131 for name in fnames:
2118 @param recursive flag indicating a recursive list is requested 2152 @param recursive flag indicating a recursive list is requested
2119 @type bool 2153 @type bool
2120 """ 2154 """
2121 from .SvnPropDelDialog import SvnPropDelDialog 2155 from .SvnPropDelDialog import SvnPropDelDialog
2122 2156
2123 dlg = SvnPropDelDialog(recursive) 2157 dlg = SvnPropDelDialog(recursive, parent=self.__ui)
2124 if dlg.exec() == QDialog.DialogCode.Accepted: 2158 if dlg.exec() == QDialog.DialogCode.Accepted:
2125 propName, recurse = dlg.getData() 2159 propName, recurse = dlg.getData()
2126 2160
2127 if not propName: 2161 if not propName:
2128 EricMessageBox.critical( 2162 EricMessageBox.critical(
2150 skipchecks and " --skip-checks" or "", 2184 skipchecks and " --skip-checks" or "",
2151 propName, 2185 propName,
2152 " ".join(fnames), 2186 " ".join(fnames),
2153 ), 2187 ),
2154 client, 2188 client,
2189 parent=self.__ui,
2155 ) 2190 )
2156 QApplication.processEvents() 2191 QApplication.processEvents()
2157 try: 2192 try:
2158 with EricMutexLocker(self.vcsExecutionMutex): 2193 with EricMutexLocker(self.vcsExecutionMutex):
2159 for name in fnames: 2194 for name in fnames:
2241 return 2276 return
2242 else: 2277 else:
2243 project = ericApp().getObject("Project") 2278 project = ericApp().getObject("Project")
2244 if nam == project.ppath and not project.saveAllScripts(): 2279 if nam == project.ppath and not project.saveAllScripts():
2245 return 2280 return
2246 dlg = SvnRevisionSelectionDialog() 2281 dlg = SvnRevisionSelectionDialog(parent=self.__ui)
2247 if dlg.exec() == QDialog.DialogCode.Accepted: 2282 if dlg.exec() == QDialog.DialogCode.Accepted:
2248 revisions = dlg.getRevisions() 2283 revisions = dlg.getRevisions()
2249 if self.diff is None: 2284 if self.diff is None:
2250 self.diff = SvnDiffDialog(self) 2285 self.diff = SvnDiffDialog(self)
2251 self.diff.show() 2286 self.diff.show()
2282 if nam == project.ppath and not project.saveAllScripts(): 2317 if nam == project.ppath and not project.saveAllScripts():
2283 return 2318 return
2284 2319
2285 dname = self.splitPath(names[0])[0] 2320 dname = self.splitPath(names[0])[0]
2286 2321
2287 dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList, dname) 2322 dlg = SvnUrlSelectionDialog(
2323 self, self.tagsList, self.branchesList, dname, parent=self.__ui
2324 )
2288 if dlg.exec() == QDialog.DialogCode.Accepted: 2325 if dlg.exec() == QDialog.DialogCode.Accepted:
2289 urls, summary = dlg.getURLs() 2326 urls, summary = dlg.getURLs()
2290 if self.diff is None: 2327 if self.diff is None:
2291 self.diff = SvnDiffDialog(self) 2328 self.diff = SvnDiffDialog(self)
2292 self.diff.show() 2329 self.diff.show()
2360 2397
2361 if isinstance(name, list): 2398 if isinstance(name, list):
2362 raise ValueError("Wrong parameter type") 2399 raise ValueError("Wrong parameter type")
2363 2400
2364 if extended: 2401 if extended:
2365 dlg = SvnRevisionSelectionDialog() 2402 dlg = SvnRevisionSelectionDialog(parent=self.__ui)
2366 if dlg.exec() == QDialog.DialogCode.Accepted: 2403 if dlg.exec() == QDialog.DialogCode.Accepted:
2367 rev1, rev2 = dlg.getRevisions() 2404 rev1, rev2 = dlg.getRevisions()
2368 if rev1 == "WORKING": 2405 if rev1 == "WORKING":
2369 rev1 = "" 2406 rev1 = ""
2370 if rev2 == "WORKING": 2407 if rev2 == "WORKING":
2438 2475
2439 @param name file/directory name to be locked 2476 @param name file/directory name to be locked
2440 @type str or list of str 2477 @type str or list of str
2441 @param stealIt flag indicating a forced operation 2478 @param stealIt flag indicating a forced operation
2442 @type bool 2479 @type bool
2443 @param parent reference to the parent object of the subversion dialog 2480 @param parent reference to the parent widget of the subversion dialog
2444 @type QWidget 2481 @type QWidget
2445 """ 2482 """
2446 comment, ok = QInputDialog.getText( 2483 comment, ok = QInputDialog.getText(
2447 None, 2484 None,
2448 self.tr("Subversion Lock"), 2485 self.tr("Subversion Lock"),
2490 2527
2491 @param name file/directory name to be unlocked 2528 @param name file/directory name to be unlocked
2492 @type str or list of str 2529 @type str or list of str
2493 @param breakIt flag indicating a forced operation 2530 @param breakIt flag indicating a forced operation
2494 @type bool 2531 @type bool
2495 @param parent reference to the parent object of the subversion dialog 2532 @param parent reference to the parent widget of the subversion dialog
2496 @type QWidget 2533 @type QWidget
2497 """ 2534 """
2498 if isinstance(name, list): 2535 if isinstance(name, list):
2499 dname, fnames = self.splitPathList(name) 2536 dname, fnames = self.splitPathList(name)
2500 else: 2537 else:
2531 @param name file/directory name relative to the project 2568 @param name file/directory name relative to the project
2532 @type str 2569 @type str
2533 """ 2570 """
2534 from .SvnInfoDialog import SvnInfoDialog 2571 from .SvnInfoDialog import SvnInfoDialog
2535 2572
2536 dlg = SvnInfoDialog(self) 2573 dlg = SvnInfoDialog(self, parent=self.__ui)
2537 dlg.start(projectPath, name) 2574 dlg.start(projectPath, name)
2538 dlg.exec() 2575 dlg.exec()
2539 2576
2540 def svnRelocate(self, projectPath): 2577 def svnRelocate(self, projectPath):
2541 """ 2578 """
2545 @type str 2582 @type str
2546 """ 2583 """
2547 from .SvnRelocateDialog import SvnRelocateDialog 2584 from .SvnRelocateDialog import SvnRelocateDialog
2548 2585
2549 currUrl = self.svnGetReposName(projectPath) 2586 currUrl = self.svnGetReposName(projectPath)
2550 dlg = SvnRelocateDialog(currUrl) 2587 dlg = SvnRelocateDialog(currUrl, parent=self.__ui)
2551 if dlg.exec() == QDialog.DialogCode.Accepted: 2588 if dlg.exec() == QDialog.DialogCode.Accepted:
2552 newUrl, inside = dlg.getData() 2589 newUrl, inside = dlg.getData()
2553 if inside: 2590 if inside:
2554 msg = "switch {0} {1}".format(newUrl, projectPath) 2591 msg = "switch {0} {1}".format(newUrl, projectPath)
2555 else: 2592 else:
2556 msg = "relocate {0} {1} {2}".format(currUrl, newUrl, projectPath) 2593 msg = "relocate {0} {1} {2}".format(currUrl, newUrl, projectPath)
2557 client = self.getClient() 2594 client = self.getClient()
2558 dlg = SvnDialog(self.tr("Relocating"), msg, client) 2595 dlg = SvnDialog(self.tr("Relocating"), msg, client, parent=self.__ui)
2559 QApplication.processEvents() 2596 QApplication.processEvents()
2560 try: 2597 try:
2561 with EricMutexLocker(self.vcsExecutionMutex): 2598 with EricMutexLocker(self.vcsExecutionMutex):
2562 if inside: 2599 if inside:
2563 client.switch(projectPath, newUrl) 2600 client.switch(projectPath, newUrl)
2608 client = self.getClient() 2645 client = self.getClient()
2609 dlg = SvnDialog( 2646 dlg = SvnDialog(
2610 self.tr("Remove from changelist"), 2647 self.tr("Remove from changelist"),
2611 "changelist --remove {0}".format(" ".join(names)), 2648 "changelist --remove {0}".format(" ".join(names)),
2612 client, 2649 client,
2650 parent=self.__ui,
2613 ) 2651 )
2614 QApplication.processEvents() 2652 QApplication.processEvents()
2615 try: 2653 try:
2616 with EricMutexLocker(self.vcsExecutionMutex): 2654 with EricMutexLocker(self.vcsExecutionMutex):
2617 for name in names: 2655 for name in names:
2647 client = self.getClient() 2685 client = self.getClient()
2648 dlg = SvnDialog( 2686 dlg = SvnDialog(
2649 self.tr("Add to changelist"), 2687 self.tr("Add to changelist"),
2650 "changelist {0}".format(" ".join(names)), 2688 "changelist {0}".format(" ".join(names)),
2651 client, 2689 client,
2690 parent=self.__ui,
2652 ) 2691 )
2653 QApplication.processEvents() 2692 QApplication.processEvents()
2654 try: 2693 try:
2655 with EricMutexLocker(self.vcsExecutionMutex): 2694 with EricMutexLocker(self.vcsExecutionMutex):
2656 for name in names: 2695 for name in names:
2701 2740
2702 @param path directory name to show change lists for 2741 @param path directory name to show change lists for
2703 @type str 2742 @type str
2704 """ 2743 """
2705 client = self.getClient() 2744 client = self.getClient()
2706 dlg = SvnDialog(self.tr("Upgrade"), "upgrade {0}".format(path), client) 2745 dlg = SvnDialog(
2746 self.tr("Upgrade"), "upgrade {0}".format(path), client, parent=self.__ui
2747 )
2707 QApplication.processEvents() 2748 QApplication.processEvents()
2708 try: 2749 try:
2709 with EricMutexLocker(self.vcsExecutionMutex): 2750 with EricMutexLocker(self.vcsExecutionMutex):
2710 client.upgrade(path) 2751 client.upgrade(path)
2711 except pysvn.ClientError as e: 2752 except pysvn.ClientError as e:

eric ide

mercurial