Plugins/VcsPlugins/vcsPySvn/subversion.py

changeset 169
a03768260179
parent 110
c9a969db1469
child 248
f4561c24989a
equal deleted inserted replaced
168:3383117f894b 169:a03768260179
789 @return flag indicating successfull operation (boolean) 789 @return flag indicating successfull operation (boolean)
790 """ 790 """
791 rx_prot = QRegExp('(file:|svn:|svn+ssh:|http:|https:).+') 791 rx_prot = QRegExp('(file:|svn:|svn+ssh:|http:|https:).+')
792 opts = self.options['global'] 792 opts = self.options['global']
793 res = False 793 res = False
794
794 if noDialog: 795 if noDialog:
795 if target is None: 796 if target is None:
796 return False 797 return False
797 force = True 798 force = True
798 accepted = True 799 accepted = True
799 else: 800 else:
800 dlg = SvnCopyDialog(name, None, True, "--force" in opts) 801 dlg = SvnCopyDialog(name, None, True, "--force" in opts)
801 accepted = (dlg.exec_() == QDialog.Accepted) 802 accepted = (dlg.exec_() == QDialog.Accepted)
802 if accepted: 803 if accepted:
803 target, force = dlg.getData() 804 target, force = dlg.getData()
805
806 if not rx_prot.exactMatch(target):
807 isDir = os.path.isdir(name)
808 else:
809 isDir = False
804 810
805 if accepted: 811 if accepted:
806 client = self.getClient() 812 client = self.getClient()
807 if rx_prot.exactMatch(target): 813 if rx_prot.exactMatch(target):
808 target = self.__svnURL(target) 814 target = self.__svnURL(target)
832 if not noDialog: 838 if not noDialog:
833 dlg.finish() 839 dlg.finish()
834 dlg.exec_() 840 dlg.exec_()
835 if res and not rx_prot.exactMatch(target): 841 if res and not rx_prot.exactMatch(target):
836 if target.startswith(project.getProjectPath()): 842 if target.startswith(project.getProjectPath()):
837 if os.path.isdir(name): 843 if isDir:
838 project.moveDirectory(name, target) 844 project.moveDirectory(name, target)
839 else: 845 else:
840 project.renameFileInPdata(name, target) 846 project.renameFileInPdata(name, target)
841 else: 847 else:
842 if os.path.isdir(name): 848 if isDir:
843 project.removeDirectory(name) 849 project.removeDirectory(name)
844 else: 850 else:
845 project.removeFile(name) 851 project.removeFile(name)
846 return res 852 return res
847 853

eric ide

mercurial