Plugins/VcsPlugins/vcsPySvn/subversion.py

changeset 2352
21971ebfaaef
parent 2318
3a3ee7cc2ad6
child 2406
975af671146d
equal deleted inserted replaced
2351:649e4f8c5cef 2352:21971ebfaaef
53 53
54 from .ProjectBrowserHelper import SvnProjectBrowserHelper 54 from .ProjectBrowserHelper import SvnProjectBrowserHelper
55 55
56 from Plugins.VcsPlugins.vcsSubversion.SvnDialog import SvnDialog as SvnProcessDialog 56 from Plugins.VcsPlugins.vcsSubversion.SvnDialog import SvnDialog as SvnProcessDialog
57 57
58 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
59
58 import Utilities 60 import Utilities
59 61
60 62
61 class Subversion(VersionControl): 63 class Subversion(VersionControl):
62 """ 64 """
1101 recurse = False 1103 recurse = False
1102 if not isinstance(name, list): 1104 if not isinstance(name, list):
1103 name = [name] 1105 name = [name]
1104 if os.path.isdir(name[0]): 1106 if os.path.isdir(name[0]):
1105 recurse = True 1107 recurse = True
1106 client = self.getClient() 1108
1107 dlg = \ 1109 project = e5App().getObject("Project")
1108 SvnDialog(self.trUtf8('Reverting changes'), 1110 names = [project.getRelativePath(nam) for nam in name]
1109 "revert {0} {1}".format((not recurse) and " --non-recursive" or "", 1111 if names[0]:
1110 " ".join(name)), 1112 dia = DeleteFilesConfirmationDialog(self.parent(),
1111 client) 1113 self.trUtf8("Revert changes"),
1112 QApplication.processEvents() 1114 self.trUtf8("Do you really want to revert all changes to these files"
1113 locker = QMutexLocker(self.vcsExecutionMutex) 1115 " or directories?"),
1114 try: 1116 name)
1115 client.revert(name, recurse) 1117 yes = dia.exec_() == QDialog.Accepted
1116 except pysvn.ClientError as e: 1118 else:
1117 dlg.showError(e.args[0]) 1119 yes = E5MessageBox.yesNo(None,
1118 locker.unlock() 1120 self.trUtf8("Revert changes"),
1119 dlg.finish() 1121 self.trUtf8("""Do you really want to revert all changes of"""
1120 dlg.exec_() 1122 """ the project?"""))
1121 self.checkVCSStatus() 1123 if yes:
1124 client = self.getClient()
1125 dlg = \
1126 SvnDialog(self.trUtf8('Reverting changes'),
1127 "revert {0} {1}".format((not recurse) and " --non-recursive" or "",
1128 " ".join(name)),
1129 client)
1130 QApplication.processEvents()
1131 locker = QMutexLocker(self.vcsExecutionMutex)
1132 try:
1133 client.revert(name, recurse)
1134 except pysvn.ClientError as e:
1135 dlg.showError(e.args[0])
1136 locker.unlock()
1137 dlg.finish()
1138 dlg.exec_()
1139 self.checkVCSStatus()
1122 1140
1123 def vcsSwitch(self, name): 1141 def vcsSwitch(self, name):
1124 """ 1142 """
1125 Public method used to switch a directory to a different tag/branch. 1143 Public method used to switch a directory to a different tag/branch.
1126 1144

eric ide

mercurial