1027 def vcsSwitch(self, name): |
1027 def vcsSwitch(self, name): |
1028 """ |
1028 """ |
1029 Public method used to switch a directory to a different tag/branch. |
1029 Public method used to switch a directory to a different tag/branch. |
1030 |
1030 |
1031 @param name directory name to be switched (string) |
1031 @param name directory name to be switched (string) |
|
1032 @return flag indicating, that the switch contained an add |
|
1033 or delete (boolean) |
1032 """ |
1034 """ |
1033 dname, fname = self.splitPath(name) |
1035 dname, fname = self.splitPath(name) |
1034 |
1036 |
1035 reposURL = self.svnGetReposName(dname) |
1037 reposURL = self.svnGetReposName(dname) |
1036 if reposURL is None: |
1038 if reposURL is None: |
1037 E5MessageBox.critical(self.__ui, |
1039 E5MessageBox.critical(self.__ui, |
1038 self.trUtf8("Subversion Error"), |
1040 self.trUtf8("Subversion Error"), |
1039 self.trUtf8("""The URL of the project repository could not be""" |
1041 self.trUtf8("""The URL of the project repository could not be""" |
1040 """ retrieved from the working copy. The switch operation will""" |
1042 """ retrieved from the working copy. The switch operation will""" |
1041 """ be aborted""")) |
1043 """ be aborted""")) |
1042 return |
1044 return False |
1043 |
1045 |
1044 if self.otherData["standardLayout"]: |
1046 if self.otherData["standardLayout"]: |
1045 url = None |
1047 url = None |
1046 else: |
1048 else: |
1047 url = self.svnNormalizeURL(reposURL) |
1049 url = self.svnNormalizeURL(reposURL) |
1051 tag, tagType = dlg.getParameters() |
1053 tag, tagType = dlg.getParameters() |
1052 if tag in self.allTagsBranchesList: |
1054 if tag in self.allTagsBranchesList: |
1053 self.allTagsBranchesList.remove(tag) |
1055 self.allTagsBranchesList.remove(tag) |
1054 self.allTagsBranchesList.insert(0, tag) |
1056 self.allTagsBranchesList.insert(0, tag) |
1055 else: |
1057 else: |
1056 return |
1058 return False |
1057 |
1059 |
1058 if self.otherData["standardLayout"]: |
1060 if self.otherData["standardLayout"]: |
1059 rx_base = QRegExp('(.+)/(trunk|tags|branches).*') |
1061 rx_base = QRegExp('(.+)/(trunk|tags|branches).*') |
1060 if not rx_base.exactMatch(reposURL): |
1062 if not rx_base.exactMatch(reposURL): |
1061 E5MessageBox.critical(self.__ui, |
1063 E5MessageBox.critical(self.__ui, |
1062 self.trUtf8("Subversion Error"), |
1064 self.trUtf8("Subversion Error"), |
1063 self.trUtf8("""The URL of the project repository has an""" |
1065 self.trUtf8("""The URL of the project repository has an""" |
1064 """ invalid format. The switch operation will""" |
1066 """ invalid format. The switch operation will""" |
1065 """ be aborted""")) |
1067 """ be aborted""")) |
1066 return |
1068 return False |
1067 |
1069 |
1068 reposRoot = rx_base.cap(1) |
1070 reposRoot = rx_base.cap(1) |
1069 tn = tag |
1071 tn = tag |
1070 if tagType == 1: |
1072 if tagType == 1: |
1071 url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag)) |
1073 url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag)) |
1091 except pysvn.ClientError as e: |
1093 except pysvn.ClientError as e: |
1092 dlg.showError(e.args[0]) |
1094 dlg.showError(e.args[0]) |
1093 locker.unlock() |
1095 locker.unlock() |
1094 dlg.finish() |
1096 dlg.finish() |
1095 dlg.exec_() |
1097 dlg.exec_() |
|
1098 res = dlg.hasAddOrDelete() |
|
1099 self.checkVCSStatus() |
|
1100 return res |
1096 |
1101 |
1097 def vcsMerge(self, name): |
1102 def vcsMerge(self, name): |
1098 """ |
1103 """ |
1099 Public method used to merge a URL/revision into the local project. |
1104 Public method used to merge a URL/revision into the local project. |
1100 |
1105 |