47 from .SvnStatusMonitorThread import SvnStatusMonitorThread |
47 from .SvnStatusMonitorThread import SvnStatusMonitorThread |
48 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig |
48 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig |
49 |
49 |
50 from .ProjectBrowserHelper import SvnProjectBrowserHelper |
50 from .ProjectBrowserHelper import SvnProjectBrowserHelper |
51 |
51 |
|
52 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
|
53 |
52 import Preferences |
54 import Preferences |
53 import Utilities |
55 import Utilities |
54 |
56 |
55 |
57 |
56 class Subversion(VersionControl): |
58 class Subversion(VersionControl): |
988 args = [] |
990 args = [] |
989 args.append('revert') |
991 args.append('revert') |
990 self.addArguments(args, self.options['global']) |
992 self.addArguments(args, self.options['global']) |
991 if isinstance(name, list): |
993 if isinstance(name, list): |
992 self.addArguments(args, name) |
994 self.addArguments(args, name) |
|
995 names = name[:] |
993 else: |
996 else: |
994 if os.path.isdir(name): |
997 if os.path.isdir(name): |
995 args.append('--recursive') |
998 args.append('--recursive') |
996 args.append(name) |
999 args.append(name) |
997 |
1000 names = [name] |
998 dia = SvnDialog(self.trUtf8('Reverting changes')) |
1001 |
999 res = dia.startProcess(args) |
1002 project = e5App().getObject("Project") |
1000 if res: |
1003 names = [project.getRelativePath(nam) for nam in names] |
1001 dia.exec_() |
1004 if names[0]: |
1002 self.checkVCSStatus() |
1005 dlg = DeleteFilesConfirmationDialog(self.parent(), |
|
1006 self.trUtf8("Revert changes"), |
|
1007 self.trUtf8("Do you really want to revert all changes to these files" |
|
1008 " or directories?"), |
|
1009 names) |
|
1010 yes = dlg.exec_() == QDialog.Accepted |
|
1011 else: |
|
1012 yes = E5MessageBox.yesNo(None, |
|
1013 self.trUtf8("Revert changes"), |
|
1014 self.trUtf8("""Do you really want to revert all changes of""" |
|
1015 """ the project?""")) |
|
1016 if yes: |
|
1017 dia = SvnDialog(self.trUtf8('Reverting changes')) |
|
1018 res = dia.startProcess(args) |
|
1019 if res: |
|
1020 dia.exec_() |
|
1021 self.checkVCSStatus() |
1003 |
1022 |
1004 def vcsSwitch(self, name): |
1023 def vcsSwitch(self, name): |
1005 """ |
1024 """ |
1006 Public method used to switch a directory to a different tag/branch. |
1025 Public method used to switch a directory to a different tag/branch. |
1007 |
1026 |