Plugins/VcsPlugins/vcsSubversion/subversion.py

changeset 537
72b32daeb8d6
parent 495
b31b0bffa5b0
child 564
b3d966393ba9
equal deleted inserted replaced
536:6d8d39753c82 537:72b32daeb8d6
13 13
14 from PyQt4.QtCore import * 14 from PyQt4.QtCore import *
15 from PyQt4.QtGui import * 15 from PyQt4.QtGui import *
16 16
17 from E5Gui.E5Application import e5App 17 from E5Gui.E5Application import e5App
18 from E5Gui import E5MessageBox
18 19
19 from VCS.VersionControl import VersionControl 20 from VCS.VersionControl import VersionControl
20 21
21 from .SvnDialog import SvnDialog 22 from .SvnDialog import SvnDialog
22 from .SvnCommitDialog import SvnCommitDialog 23 from .SvnCommitDialog import SvnCommitDialog
202 @param vcsDataDict dictionary of data required for the conversion 203 @param vcsDataDict dictionary of data required for the conversion
203 @param project reference to the project object 204 @param project reference to the project object
204 """ 205 """
205 success = self.vcsImport(vcsDataDict, project.ppath)[0] 206 success = self.vcsImport(vcsDataDict, project.ppath)[0]
206 if not success: 207 if not success:
207 QMessageBox.critical(None, 208 E5MessageBox.critical(self.__ui,
208 self.trUtf8("Create project in repository"), 209 self.trUtf8("Create project in repository"),
209 self.trUtf8("""The project could not be created in the repository.""" 210 self.trUtf8("""The project could not be created in the repository."""
210 """ Maybe the given repository doesn't exist or the""" 211 """ Maybe the given repository doesn't exist or the"""
211 """ repository server is down.""")) 212 """ repository server is down."""))
212 else: 213 else:
224 self.vcsCommit(project.ppath, vcsDataDict["message"], True) 225 self.vcsCommit(project.ppath, vcsDataDict["message"], True)
225 pfn = project.pfile 226 pfn = project.pfile
226 if not os.path.isfile(pfn): 227 if not os.path.isfile(pfn):
227 pfn += "z" 228 pfn += "z"
228 if not os.path.isfile(pfn): 229 if not os.path.isfile(pfn):
229 QMessageBox.critical(None, 230 E5MessageBox.critical(self.__ui,
230 self.trUtf8("New project"), 231 self.trUtf8("New project"),
231 self.trUtf8("""The project could not be checked out of the""" 232 self.trUtf8("""The project could not be checked out of the"""
232 """ repository.<br />""" 233 """ repository.<br />"""
233 """Restoring the original contents.""")) 234 """Restoring the original contents."""))
234 if os.getcwd() == project.ppath: 235 if os.getcwd() == project.ppath:
806 """ 807 """
807 dname, fname = self.splitPath(name) 808 dname, fname = self.splitPath(name)
808 809
809 reposURL = self.svnGetReposName(dname) 810 reposURL = self.svnGetReposName(dname)
810 if reposURL is None: 811 if reposURL is None:
811 QMessageBox.critical(None, 812 E5MessageBox.critical(self.__ui,
812 self.trUtf8("Subversion Error"), 813 self.trUtf8("Subversion Error"),
813 self.trUtf8("""The URL of the project repository could not be""" 814 self.trUtf8("""The URL of the project repository could not be"""
814 """ retrieved from the working copy. The tag operation will""" 815 """ retrieved from the working copy. The tag operation will"""
815 """ be aborted""")) 816 """ be aborted"""))
816 return 817 return
830 return 831 return
831 832
832 if self.otherData["standardLayout"]: 833 if self.otherData["standardLayout"]:
833 rx_base = QRegExp('(.+)/(trunk|tags|branches).*') 834 rx_base = QRegExp('(.+)/(trunk|tags|branches).*')
834 if not rx_base.exactMatch(reposURL): 835 if not rx_base.exactMatch(reposURL):
835 QMessageBox.critical(None, 836 E5MessageBox.critical(self.__ui,
836 self.trUtf8("Subversion Error"), 837 self.trUtf8("Subversion Error"),
837 self.trUtf8("""The URL of the project repository has an""" 838 self.trUtf8("""The URL of the project repository has an"""
838 """ invalid format. The tag operation will""" 839 """ invalid format. The tag operation will"""
839 """ be aborted""")) 840 """ be aborted"""))
840 return 841 return
900 """ 901 """
901 dname, fname = self.splitPath(name) 902 dname, fname = self.splitPath(name)
902 903
903 reposURL = self.svnGetReposName(dname) 904 reposURL = self.svnGetReposName(dname)
904 if reposURL is None: 905 if reposURL is None:
905 QMessageBox.critical(None, 906 E5MessageBox.critical(self.__ui,
906 self.trUtf8("Subversion Error"), 907 self.trUtf8("Subversion Error"),
907 self.trUtf8("""The URL of the project repository could not be""" 908 self.trUtf8("""The URL of the project repository could not be"""
908 """ retrieved from the working copy. The switch operation will""" 909 """ retrieved from the working copy. The switch operation will"""
909 """ be aborted""")) 910 """ be aborted"""))
910 return 911 return
924 return 925 return
925 926
926 if self.otherData["standardLayout"]: 927 if self.otherData["standardLayout"]:
927 rx_base = QRegExp('(.+)/(trunk|tags|branches).*') 928 rx_base = QRegExp('(.+)/(trunk|tags|branches).*')
928 if not rx_base.exactMatch(reposURL): 929 if not rx_base.exactMatch(reposURL):
929 QMessageBox.critical(None, 930 E5MessageBox.critical(self.__ui,
930 self.trUtf8("Subversion Error"), 931 self.trUtf8("Subversion Error"),
931 self.trUtf8("""The URL of the project repository has an""" 932 self.trUtf8("""The URL of the project repository has an"""
932 """ invalid format. The switch operation will""" 933 """ invalid format. The switch operation will"""
933 """ be aborted""")) 934 """ be aborted"""))
934 return 935 return
1382 """ 1383 """
1383 dlg = SvnPropSetDialog() 1384 dlg = SvnPropSetDialog()
1384 if dlg.exec_() == QDialog.Accepted: 1385 if dlg.exec_() == QDialog.Accepted:
1385 propName, fileFlag, propValue = dlg.getData() 1386 propName, fileFlag, propValue = dlg.getData()
1386 if not propName: 1387 if not propName:
1387 QMessageBox.critical(None, 1388 E5MessageBox.critical(self.__ui,
1388 self.trUtf8("Subversion Set Property"), 1389 self.trUtf8("Subversion Set Property"),
1389 self.trUtf8("""You have to supply a property name. Aborting.""")) 1390 self.trUtf8("""You have to supply a property name. Aborting."""))
1390 return 1391 return
1391 1392
1392 args = [] 1393 args = []
1425 1426
1426 if not ok: 1427 if not ok:
1427 return 1428 return
1428 1429
1429 if not propName: 1430 if not propName:
1430 QMessageBox.critical(None, 1431 E5MessageBox.critical(self.__ui,
1431 self.trUtf8("Subversion Delete Property"), 1432 self.trUtf8("Subversion Delete Property"),
1432 self.trUtf8("""You have to supply a property name. Aborting.""")) 1433 self.trUtf8("""You have to supply a property name. Aborting."""))
1433 return 1434 return
1434 1435
1435 args = [] 1436 args = []

eric ide

mercurial