eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8176
31965986ecd1
parent 8259
2bbec88047dd
equal deleted inserted replaced
8190:fb0ef164f536 8273:698ae46f40a4
865 if accepted: 865 if accepted:
866 target, force = dlg.getData() 866 target, force = dlg.getData()
867 if not target: 867 if not target:
868 return False 868 return False
869 869
870 if rx_prot.fullmatch(target) is None: 870 isDir = (os.path.isdir(name) if rx_prot.fullmatch(target) is None
871 isDir = os.path.isdir(name) 871 else False)
872 else:
873 isDir = False
874 872
875 if accepted: 873 if accepted:
876 args = [] 874 args = []
877 args.append('move') 875 args.append('move')
878 self.addArguments(args, opts) 876 self.addArguments(args, opts)
917 being edited and has unsaved modification, they can be saved or the 915 being edited and has unsaved modification, they can be saved or the
918 operation may be aborted. 916 operation may be aborted.
919 917
920 @param name file/directory name to be diffed (string) 918 @param name file/directory name to be diffed (string)
921 """ 919 """
922 if isinstance(name, list): 920 names = name[:] if isinstance(name, list) else [name]
923 names = name[:]
924 else:
925 names = [name]
926 for nam in names: 921 for nam in names:
927 if os.path.isfile(nam): 922 if os.path.isfile(nam):
928 editor = e5App().getObject("ViewManager").getOpenEditor(nam) 923 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
929 if editor and not editor.checkDirty(): 924 if editor and not editor.checkDirty():
930 return 925 return
973 """The URL of the project repository could not be""" 968 """The URL of the project repository could not be"""
974 """ retrieved from the working copy. The tag operation""" 969 """ retrieved from the working copy. The tag operation"""
975 """ will be aborted""")) 970 """ will be aborted"""))
976 return 971 return
977 972
978 if self.otherData["standardLayout"]: 973 url = (
979 url = None 974 None
980 else: 975 if self.otherData["standardLayout"] else
981 url = self.svnNormalizeURL(reposURL) 976 self.svnNormalizeURL(reposURL)
977 )
982 from .SvnTagDialog import SvnTagDialog 978 from .SvnTagDialog import SvnTagDialog
983 dlg = SvnTagDialog(self.allTagsBranchesList, url, 979 dlg = SvnTagDialog(self.allTagsBranchesList, url,
984 self.otherData["standardLayout"]) 980 self.otherData["standardLayout"])
985 if dlg.exec() == QDialog.DialogCode.Accepted: 981 if dlg.exec() == QDialog.DialogCode.Accepted:
986 tag, tagOp = dlg.getParameters() 982 tag, tagOp = dlg.getParameters()
1096 """The URL of the project repository could not be""" 1092 """The URL of the project repository could not be"""
1097 """ retrieved from the working copy. The switch""" 1093 """ retrieved from the working copy. The switch"""
1098 """ operation will be aborted""")) 1094 """ operation will be aborted"""))
1099 return False 1095 return False
1100 1096
1101 if self.otherData["standardLayout"]: 1097 url = (
1102 url = None 1098 None
1103 else: 1099 if self.otherData["standardLayout"] else
1104 url = self.svnNormalizeURL(reposURL) 1100 self.svnNormalizeURL(reposURL)
1101 )
1105 from .SvnSwitchDialog import SvnSwitchDialog 1102 from .SvnSwitchDialog import SvnSwitchDialog
1106 dlg = SvnSwitchDialog(self.allTagsBranchesList, url, 1103 dlg = SvnSwitchDialog(self.allTagsBranchesList, url,
1107 self.otherData["standardLayout"]) 1104 self.otherData["standardLayout"])
1108 if dlg.exec() == QDialog.DialogCode.Accepted: 1105 if dlg.exec() == QDialog.DialogCode.Accepted:
1109 tag, tagType = dlg.getParameters() 1106 tag, tagType = dlg.getParameters()
1325 if dname.endswith(os.sep): 1322 if dname.endswith(os.sep):
1326 dname = dname[:-1] 1323 dname = dname[:-1]
1327 dname = os.path.normcase(dname) 1324 dname = os.path.normcase(dname)
1328 1325
1329 found = False 1326 found = False
1330 for name in self.statusCache.keys(): 1327 for name in self.statusCache:
1331 if name in names: 1328 if name in names:
1332 found = True 1329 found = True
1333 names[name] = self.statusCache[name] 1330 names[name] = self.statusCache[name]
1334 1331
1335 if not found: 1332 if not found:
1891 1888
1892 This method gives the chance to enter the revisions to be compared. 1889 This method gives the chance to enter the revisions to be compared.
1893 1890
1894 @param name file/directory name to be diffed (string) 1891 @param name file/directory name to be diffed (string)
1895 """ 1892 """
1896 if isinstance(name, list): 1893 names = name[:] if isinstance(name, list) else [name]
1897 names = name[:]
1898 else:
1899 names = [name]
1900 for nam in names: 1894 for nam in names:
1901 if os.path.isfile(nam): 1895 if os.path.isfile(nam):
1902 editor = e5App().getObject("ViewManager").getOpenEditor(nam) 1896 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
1903 if editor and not editor.checkDirty(): 1897 if editor and not editor.checkDirty():
1904 return 1898 return
1927 1921
1928 This method gives the chance to enter the revisions to be compared. 1922 This method gives the chance to enter the revisions to be compared.
1929 1923
1930 @param name file/directory name to be diffed (string) 1924 @param name file/directory name to be diffed (string)
1931 """ 1925 """
1932 if isinstance(name, list): 1926 names = name[:] if isinstance(name, list) else [name]
1933 names = name[:]
1934 else:
1935 names = [name]
1936 for nam in names: 1927 for nam in names:
1937 if os.path.isfile(nam): 1928 if os.path.isfile(nam):
1938 editor = e5App().getObject("ViewManager").getOpenEditor(nam) 1929 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
1939 if editor and not editor.checkDirty(): 1930 if editor and not editor.checkDirty():
1940 return 1931 return
2166 """ 2157 """
2167 Public method to open the repository browser. 2158 Public method to open the repository browser.
2168 2159
2169 @param projectPath path name of the project (string) 2160 @param projectPath path name of the project (string)
2170 """ 2161 """
2171 if projectPath: 2162 url = self.svnGetReposName(projectPath) if projectPath else None
2172 url = self.svnGetReposName(projectPath)
2173 else:
2174 url = None
2175 2163
2176 if url is None: 2164 if url is None:
2177 url, ok = QInputDialog.getText( 2165 url, ok = QInputDialog.getText(
2178 None, 2166 None,
2179 self.tr("Repository Browser"), 2167 self.tr("Repository Browser"),

eric ide

mercurial