eric6/Plugins/VcsPlugins/vcsPySvn/subversion.py

Tue, 13 Apr 2021 18:02:59 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 13 Apr 2021 18:02:59 +0200
changeset 8234
fcb6b4b96274
parent 8205
4a0f1f896341
child 8243
cc717c2ae956
permissions
-rw-r--r--

Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7900
diff changeset
3 # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the version control systems interface to Subversion.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
10 import re
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 import shutil
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 import time
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
14 from urllib.parse import quote
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
16 from PyQt5.QtCore import pyqtSignal, Qt, QDateTime, QCoreApplication
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
17 from PyQt5.QtWidgets import QLineEdit, QDialog, QInputDialog, QApplication
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
19 from E5Gui.E5Application import e5App
537
72b32daeb8d6 Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 495
diff changeset
20 from E5Gui import E5MessageBox
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
22 from E5Utilities.E5MutexLocker import E5MutexLocker
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
23
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 from VCS.VersionControl import VersionControl
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 import pysvn
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
28 from .SvnDialog import SvnDialog
1880
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
29 from .SvnUtilities import getConfigPath, amendConfig, createDefaultConfig
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
33
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 class Subversion(VersionControl):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 Class implementing the version control systems interface to Subversion.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 @signal committed() emitted after the commit action has completed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 442
diff changeset
40 committed = pyqtSignal()
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 442
diff changeset
41
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
42 def __init__(self, plugin, parent=None, name=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 @param plugin reference to the plugin object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 @param parent parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 @param name name of this object (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 VersionControl.__init__(self, parent, name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.defaultOptions = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
52 'global': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
53 'commit': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
54 'checkout': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
55 'update': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
56 'add': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
57 'remove': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
58 'diff': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
59 'log': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
60 'history': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
61 'status': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
62 'tag': [''],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
63 'export': ['']
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.interestingDataKeys = [
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 "standardLayout",
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 ]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 self.__plugin = plugin
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 self.__ui = parent
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.options = self.defaultOptions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.otherData["standardLayout"] = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self.tagsList = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 self.branchesList = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.allTagsBranchesList = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.mergeList = [[], [], []]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.showedTags = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.showedBranches = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 self.tagTypeList = [
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
82 'tags',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 'branches'
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 ]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.commandHistory = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.wdHistory = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
89 if (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
90 pysvn.version >= (1, 4, 3, 0) and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
91 "SVN_ASP_DOT_NET_HACK" in os.environ
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
92 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.adminDir = '_svn'
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.adminDir = '.svn'
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.log = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.diff = None
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
99 self.sbsDiff = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.status = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.propList = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self.tagbranchList = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.blame = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 self.repoBrowser = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.logBrowser = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.statusCache = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__commitData = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.__commitDialog = None
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
111
3621
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3598
diff changeset
112 self.__wcng = True
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3598
diff changeset
113 # assume new generation working copy metadata format
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 def getPlugin(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 Public method to get a reference to the plugin object.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 @return reference to the plugin object (VcsPySvnPlugin)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 return self.__plugin
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 def getClient(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 Public method to create and initialize the pysvn client object.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 @return the pysvn client object (pysvn.Client)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 configDir = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 authCache = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 for arg in self.options['global']:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 if arg.startswith("--config-dir"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 configDir = arg.split("=", 1)[1]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 if arg.startswith("--no-auth-cache"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 authCache = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 client = pysvn.Client(configDir)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 client.exception_style = 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 client.set_auth_cache(authCache)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 return client
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
143 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 ## Methods of the VCS interface
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
145 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 def vcsShutdown(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 Public method used to shutdown the Subversion interface.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 if self.log is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.log.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 if self.diff is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 self.diff.close()
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
155 if self.sbsDiff is not None:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
156 self.sbsDiff.close()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 if self.status is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 self.status.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 if self.propList is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 self.propList.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 if self.tagbranchList is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 self.tagbranchList.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 if self.blame is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 self.blame.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 if self.repoBrowser is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 self.repoBrowser.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 if self.logBrowser is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 self.logBrowser.close()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 def vcsExists(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 Public method used to test for the presence of the svn executable.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
174 @return flag indicating the existance (boolean) and an error message
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
175 (string)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.versionStr = ".".join([str(v) for v in pysvn.svn_version[:-1]])
1268
4fc337f391c9 Fixed the treatment of the Subversion version number.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1267
diff changeset
178 self.version = pysvn.svn_version[:-1]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 return True, ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
181 def vcsInit(self, vcsDir, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 Public method used to initialize the subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
185 The subversion repository has to be initialized from outside eric
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 because the respective command always works locally. Therefore we
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 always return TRUE without doing anything.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 @param vcsDir name of the VCS directory (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 @param noDialog flag indicating quiet operations (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 @return always TRUE
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 return True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
195 def vcsConvertProject(self, vcsDataDict, project, addAll=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
197 Public method to convert an uncontrolled project to a version
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
198 controlled project.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 @param vcsDataDict dictionary of data required for the conversion
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
201 @type dict
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 @param project reference to the project object
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
203 @type Project
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
204 @param addAll flag indicating to add all files to the repository
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
205 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 """
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
207 success = self.vcsImport(vcsDataDict, project.ppath, addAll=addAll)[0]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 if not success:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
209 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
210 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
211 self.tr("Create project in repository"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
212 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
213 """The project could not be created in the repository."""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
214 """ Maybe the given repository doesn't exist or the"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
215 """ repository server is down."""))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 cwdIsPpath = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 if os.getcwd() == project.ppath:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 os.chdir(os.path.dirname(project.ppath))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 cwdIsPpath = True
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
221 tmpProjectDir = "{0}_tmp".format(project.ppath)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 shutil.rmtree(tmpProjectDir, True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 os.rename(project.ppath, tmpProjectDir)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 os.makedirs(project.ppath)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 self.vcsCheckout(vcsDataDict, project.ppath)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 if cwdIsPpath:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 os.chdir(project.ppath)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 self.vcsCommit(project.ppath, vcsDataDict["message"], True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 pfn = project.pfile
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 if not os.path.isfile(pfn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 pfn += "z"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 if not os.path.isfile(pfn):
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
233 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
234 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
235 self.tr("New project"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
236 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
237 """The project could not be checked out of the"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
238 """ repository.<br />"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
239 """Restoring the original contents."""))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 if os.getcwd() == project.ppath:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 os.chdir(os.path.dirname(project.ppath))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 cwdIsPpath = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 cwdIsPpath = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 shutil.rmtree(project.ppath, True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 os.rename(tmpProjectDir, project.ppath)
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
247 project.pdata["VCS"] = 'None'
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 project.vcs = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 project.setDirty(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 project.saveProject()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 project.closeProject()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 shutil.rmtree(tmpProjectDir, True)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
254 project.closeProject(noSave=True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 project.openProject(pfn)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
257 def vcsImport(self, vcsDataDict, projectDir, noDialog=False, addAll=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
259 Public method used to import the project into the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
260 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 @param vcsDataDict dictionary of data required for the import
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
263 @type dict
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 @param projectDir project directory (string)
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
265 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 @param noDialog flag indicating quiet operations
7167
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
267 @type bool
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
268 @param addAll flag indicating to add all files to the repository
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
269 @type bool
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
270 @return tuple containing a flag indicating an execution without errors
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
271 and a flag indicating the version controll status
b3557e77314a VCS: extended the vcsImport function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
272 @rtype tuple of (bool, bool)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 noDialog = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 msg = vcsDataDict["message"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 if not msg:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 msg = '***'
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 vcsDir = self.svnNormalizeURL(vcsDataDict["url"])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 if vcsDir.startswith('/'):
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
281 vcsDir = 'file://{0}'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 elif vcsDir[1] in ['|', ':']:
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
283 vcsDir = 'file:///{0}'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 project = vcsDir[vcsDir.rfind('/') + 1:]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 # create the dir structure to be imported into the repository
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
288 tmpDir = '{0}_tmp'.format(projectDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 os.makedirs(tmpDir)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 if self.otherData["standardLayout"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 os.mkdir(os.path.join(tmpDir, project))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 os.mkdir(os.path.join(tmpDir, project, 'branches'))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 os.mkdir(os.path.join(tmpDir, project, 'tags'))
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
295 shutil.copytree(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
296 projectDir, os.path.join(tmpDir, project, 'trunk'))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 shutil.copytree(projectDir, os.path.join(tmpDir, project))
6360
73033fa6a99c Fixed some pyflakes warnings detected by the upgraded version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
299 except OSError:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 if os.path.isdir(tmpDir):
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
301 shutil.rmtree(tmpDir, True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 return False, False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 os.chdir(os.path.join(tmpDir, project))
71
f21321d97145 Fixed an issue with creating a new project with VCS control.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 65
diff changeset
306 opts = self.options['global']
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 recurse = "--non-recursive" not in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 url = self.__svnURL(vcsDir)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 if not noDialog:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
311 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
312 self.tr('Importing project into Subversion repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
313 "import{0} --message {1} .".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
314 (not recurse) and " --non-recursive" or "", msg),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
315 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
318 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
319 rev = client.import_(".", url, msg, recurse, ignore=True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 status = True
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
321 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 status = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 rev = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 if not noDialog:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
327 rev and dlg.showMessage(self.tr("Imported revision {0}.\n")
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
328 .format(rev.number))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
330 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 shutil.rmtree(tmpDir, True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 return status, False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
336 def vcsCheckout(self, vcsDataDict, projectDir, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
338 Public method used to check the project out of the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
339 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 @param vcsDataDict dictionary of data required for the checkout
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 @param projectDir project directory to create (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 @param noDialog flag indicating quiet operations
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 @return flag indicating an execution without errors (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 noDialog = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 tag = vcsDataDict["tag"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 except KeyError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 tag = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 vcsDir = self.svnNormalizeURL(vcsDataDict["url"])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 if vcsDir.startswith('/'):
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
353 vcsDir = 'file://{0}'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 elif vcsDir[1] in ['|', ':']:
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
355 vcsDir = 'file:///{0}'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 if self.otherData["standardLayout"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 if tag is None or tag == '':
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
359 svnUrl = '{0}/trunk'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 else:
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
361 if (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
362 not tag.startswith('tags') and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
363 not tag.startswith('branches')
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
364 ):
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
365 type_, ok = QInputDialog.getItem(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
367 self.tr("Subversion Checkout"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
368 self.tr(
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
369 "The tag must be a normal tag (tags) or"
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 " a branch tag (branches)."
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 " Please select from the list."),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 self.tagTypeList,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 0, False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 if not ok:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 return False
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
376 tag = '{0}/{1}'.format(type_, tag)
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
377 svnUrl = '{0}/{1}'.format(vcsDir, tag)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 svnUrl = vcsDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 opts = self.options['global'] + self.options['checkout']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 recurse = "--non-recursive" not in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 url = self.__svnURL(svnUrl)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 if not noDialog:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
386 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
387 self.tr('Checking project out of Subversion repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
388 "checkout{0} {1} {2}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
389 (not recurse) and " --non-recursive" or "",
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
390 url, projectDir),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
391 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
394 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
395 client.checkout(url, projectDir, recurse)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 status = True
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
397 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 status = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
403 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 return status
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 def vcsExport(self, vcsDataDict, projectDir):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
408 Public method used to export a directory from the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
409 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 @param vcsDataDict dictionary of data required for the checkout
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 @param projectDir project directory to create (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 @return flag indicating an execution without errors (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 tag = vcsDataDict["tag"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 except KeyError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 tag = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 vcsDir = self.svnNormalizeURL(vcsDataDict["url"])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 if vcsDir.startswith('/') or vcsDir[1] == '|':
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
421 vcsDir = 'file://{0}'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 if self.otherData["standardLayout"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 if tag is None or tag == '':
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
425 svnUrl = '{0}/trunk'.format(vcsDir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 else:
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
427 if (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
428 not tag.startswith('tags') and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
429 not tag.startswith('branches')
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
430 ):
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
431 type_, ok = QInputDialog.getItem(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
433 self.tr("Subversion Export"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
434 self.tr(
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
435 "The tag must be a normal tag (tags) or"
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 " a branch tag (branches)."
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 " Please select from the list."),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 self.tagTypeList,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 0, False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 if not ok:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 return False
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
442 tag = '{0}/{1}'.format(type_, tag)
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
443 svnUrl = '{0}/{1}'.format(vcsDir, tag)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 svnUrl = vcsDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 opts = self.options['global']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 recurse = "--non-recursive" not in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 url = self.__svnURL(svnUrl)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 client = self.getClient()
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
451 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
452 self.tr('Exporting project from Subversion repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
453 "export --force{0} {1} {2}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
454 (not recurse) and " --non-recursive" or "",
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
455 url, projectDir),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
456 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
459 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
460 client.export(url, projectDir, force=True, recurse=recurse)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 status = True
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
462 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 status = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
466 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 return status
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
469 def vcsCommit(self, name, message, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
471 Public method used to make the change of a file/directory permanent
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
472 in the Subversion repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
474 @param name file/directory name to be committed (string or
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
475 list of strings)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 @param message message for this operation (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 @param noDialog flag indicating quiet operations
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 if not noDialog and not message:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 # call CommitDialog and get message from there
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 if self.__commitDialog is None:
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
482 from .SvnCommitDialog import SvnCommitDialog
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
483 self.__commitDialog = SvnCommitDialog(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
484 self.svnGetChangelists(), self.__ui)
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 442
diff changeset
485 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 self.__commitDialog.show()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487 self.__commitDialog.raise_()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 self.__commitDialog.activateWindow()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490 self.__commitData["name"] = name
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 self.__commitData["msg"] = message
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 self.__commitData["noDialog"] = noDialog
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 if noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495 self.__vcsCommit_Step2()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 def __vcsCommit_Step2(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 Private slot performing the second step of the commit action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 name = self.__commitData["name"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 msg = self.__commitData["msg"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 noDialog = self.__commitData["noDialog"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504
2222
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
505 if not noDialog:
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
506 # check, if there are unsaved changes, that should be committed
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
507 if isinstance(name, list):
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
508 nameList = name
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
509 else:
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
510 nameList = [name]
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
511 ok = True
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
512 for nam in nameList:
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
513 # check for commit of the project
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
514 if os.path.isdir(nam):
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
515 project = e5App().getObject("Project")
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
516 if nam == project.getProjectPath():
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
517 ok &= project.checkAllScriptsDirty(
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
518 reportSyntaxErrors=True) and project.checkDirty()
2222
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
519 continue
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
520 elif os.path.isfile(nam):
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
521 editor = e5App().getObject("ViewManager").getOpenEditor(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
522 nam)
2222
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
523 if editor:
2280
8e85ca3fabe7 Fixed a few PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2222
diff changeset
524 ok &= editor.checkDirty()
2222
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
525 if not ok:
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
526 break
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
527
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
528 if not ok:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
529 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
530 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
531 self.tr("Commit Changes"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
532 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
533 """The commit affects files, that have unsaved"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
534 """ changes. Shall the commit be continued?"""),
2280
8e85ca3fabe7 Fixed a few PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2222
diff changeset
535 icon=E5MessageBox.Warning)
2222
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
536 if not res:
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
537 return
105f425944a2 Extended the commit of all supported version control system interfaces to check for unsaved changes, that would otherwise be forgotten.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
538
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 if self.__commitDialog is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 msg = self.__commitDialog.logMessage()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 if self.__commitDialog.hasChangelists():
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
542 changelists, keepChangelists = (
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
543 self.__commitDialog.changelistsData()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
544 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 changelists, keepChangelists = [], False
2318
3a3ee7cc2ad6 Changed some signal handlings (disconnect).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
547 self.__commitDialog.deleteLater()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 self.__commitDialog = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 changelists, keepChangelists = [], False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 if not msg:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 msg = '***'
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
555 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
561 if (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
562 self.svnGetReposName(dname).startswith('http') or
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
563 self.svnGetReposName(dname).startswith('svn')
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
564 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 noDialog = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569 opts = self.options['global'] + self.options['commit']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 recurse = "--non-recursive" not in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 keeplocks = "--keep-locks" in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 if not noDialog:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
574 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
575 self.tr('Commiting changes to Subversion repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
576 "commit{0}{1}{2}{3} --message {4} {5}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
577 (not recurse) and " --non-recursive" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
578 keeplocks and " --keep-locks" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
579 keepChangelists and " --keep-changelists" or "",
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3024
diff changeset
580 changelists and
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
581 " --changelist ".join([""] + changelists) or "",
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
582 msg, " ".join(fnames)),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
583 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
584 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
585 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
586 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
587 if changelists:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
588 rev = client.checkin(fnames, msg,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
589 recurse=recurse, keep_locks=keeplocks,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
590 keep_changelist=keepChangelists,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
591 changelists=changelists)
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
592 else:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
593 rev = client.checkin(fnames, msg,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
594 recurse=recurse, keep_locks=keeplocks)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
595 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
596 rev = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
597 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
598 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
599 if not noDialog:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
600 rev and dlg.showMessage(self.tr("Committed revision {0}.")
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
601 .format(rev.number))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
602 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
603 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
604 os.chdir(cwd)
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 442
diff changeset
605 self.committed.emit()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
606 self.checkVCSStatus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
608 def vcsUpdate(self, name, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
609 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
610 Public method used to update a file/directory with the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
611 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
613 @param name file/directory name to be updated (string or list of
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
614 strings)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615 @param noDialog flag indicating quiet operations (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 @return flag indicating, that the update contained an add
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617 or delete (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
619 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
624
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627 opts = self.options['global'] + self.options['update']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 recurse = "--non-recursive" not in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630 if not noDialog:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
631 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
632 self.tr('Synchronizing with the Subversion repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
633 "update{0} {1}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
634 (not recurse) and " --non-recursive" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
635 " ".join(fnames)),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
636 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
638 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
639 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
640 client.update(fnames, recurse)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
641 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
643 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
644 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
645 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 res = dlg.hasAddOrDelete()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648 res = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
649 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
650 self.checkVCSStatus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
651 return res
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
652
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
653 def vcsAdd(self, name, isDir=False, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
654 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
655 Public method used to add a file/directory to the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
656 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
658 @param name file/directory name to be added (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
659 @param isDir flag indicating name is a directory (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
660 @param noDialog flag indicating quiet operations (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
662 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
663 if isDir:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
664 dname, fname = os.path.split(name[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
665 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
666 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
667 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668 if isDir:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
669 dname, fname = os.path.split(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
670 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
671 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
672 names = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673 tree = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
674 wdir = dname
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
675 if self.__wcng:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
676 repodir = dname
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
677 while not os.path.isdir(os.path.join(repodir, self.adminDir)):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
678 repodir = os.path.dirname(repodir)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
679 if os.path.splitdrive(repodir)[1] == os.sep:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
680 return # oops, project is not version controlled
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
681 while (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
682 os.path.normcase(dname) != os.path.normcase(repodir) and
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
683 (os.path.normcase(dname) not in self.statusCache or
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
684 self.statusCache[os.path.normcase(dname)] ==
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
685 self.canBeAdded)
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
686 ):
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
687 # add directories recursively, if they aren't in the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
688 # repository already
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
689 tree.insert(-1, dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
690 dname = os.path.dirname(dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
691 wdir = dname
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
692 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
693 while not os.path.exists(os.path.join(dname, self.adminDir)):
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
694 # add directories recursively, if they aren't in the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
695 # repository already
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
696 tree.insert(-1, dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
697 dname = os.path.dirname(dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
698 wdir = dname
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
699 names.extend(tree)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
700
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
701 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
702 tree2 = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
703 for n in name:
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
704 d = os.path.dirname(n)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
705 if self.__wcng:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
706 repodir = d
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
707 while not os.path.isdir(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
708 os.path.join(repodir, self.adminDir)):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
709 repodir = os.path.dirname(repodir)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
710 if os.path.splitdrive(repodir)[1] == os.sep:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
711 return # oops, project is not version controlled
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
712 while (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
713 (os.path.normcase(d) != os.path.normcase(repodir)) and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
714 (d not in tree2 + tree) and
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
715 (os.path.normcase(d) not in self.statusCache or
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
716 self.statusCache[os.path.normcase(d)] ==
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
717 self.canBeAdded)
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
718 ):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
719 tree2.append(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
720 d = os.path.dirname(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
721 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
722 while not os.path.exists(os.path.join(d, self.adminDir)):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
723 if d in tree2 + tree:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
724 break
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
725 tree2.append(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
726 d = os.path.dirname(d)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 tree2.reverse()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 names.extend(tree2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
729 names.extend(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
730 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731 names.append(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
733 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 os.chdir(wdir)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
735 opts = self.options['global'] + self.options['add']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
736 recurse = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
737 force = "--force" in opts or noDialog
87
4cc5c8d1184d Change PySvn code to ignore unwanted files in the add command.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 71
diff changeset
738 noignore = "--no-ignore" in opts
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
739 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
740 if not noDialog:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
741 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
742 self.tr('Adding files/directories to the Subversion'
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
743 ' repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
744 "add --non-recursive{0}{1} {2}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
745 force and " --force" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
746 noignore and " --no-ignore" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
747 " ".join(names)),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
748 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
751 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
752 client.add(names, recurse=recurse, force=force,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
753 ignore=not noignore)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
754 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
755 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
756 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
757 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
758 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
759 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
761
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
762 def vcsAddBinary(self, name, isDir=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
763 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 Public method used to add a file/directory in binary mode to the
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765 Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
767 @param name file/directory name to be added (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
768 @param isDir flag indicating name is a directory (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
769 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
770 self.vcsAdd(name, isDir)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
771
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
772 def vcsAddTree(self, path):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
773 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
774 Public method to add a directory tree rooted at path to the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
775 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
776
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
777 @param path root directory of the tree to be added (string or list of
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
778 strings))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
779 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
780 tree = []
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
781 if isinstance(path, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782 dname, fnames = self.splitPathList(path)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783 for n in path:
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
784 d = os.path.dirname(n)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
785 if self.__wcng:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
786 repodir = d
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
787 while not os.path.isdir(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
788 os.path.join(repodir, self.adminDir)):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
789 repodir = os.path.dirname(repodir)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
790 if os.path.splitdrive(repodir)[1] == os.sep:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
791 return # oops, project is not version controlled
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
792 while (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
793 (os.path.normcase(d) != os.path.normcase(repodir)) and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
794 (d not in tree) and
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
795 (os.path.normcase(d) not in self.statusCache or
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
796 self.statusCache[os.path.normcase(d)] ==
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
797 self.canBeAdded)
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
798 ):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
799 tree.append(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
800 d = os.path.dirname(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
801 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
802 while not os.path.exists(os.path.join(d, self.adminDir)):
1588
dccffd13be8d Did some PEP-8 related corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1576
diff changeset
803 # add directories recursively,
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
804 # if they aren't in the repository already
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
805 if d in tree:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
806 break
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
807 tree.append(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
808 d = os.path.dirname(d)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
809 tree.reverse()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
810 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
811 dname, fname = os.path.split(path)
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
812 if self.__wcng:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
813 repodir = dname
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
814 while not os.path.isdir(os.path.join(repodir, self.adminDir)):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
815 repodir = os.path.dirname(repodir)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
816 if os.path.splitdrive(repodir)[1] == os.sep:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
817 return # oops, project is not version controlled
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
818 while (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
819 (os.path.normcase(dname) != os.path.normcase(repodir)) and
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
820 (os.path.normcase(dname) not in self.statusCache or
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
821 self.statusCache[os.path.normcase(dname)] ==
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
822 self.canBeAdded)
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
823 ):
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
824 # add directories recursively, if they aren't in the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
825 # repository already
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
826 tree.insert(-1, dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
827 dname = os.path.dirname(dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
828 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
829 while not os.path.exists(os.path.join(dname, self.adminDir)):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
830 # add directories recursively,
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
831 # if they aren't in the repository already
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
832 tree.insert(-1, dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
833 dname = os.path.dirname(dname)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 if tree:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 self.vcsAdd(tree, True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
837 names = []
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
838 if isinstance(path, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 names.extend(path)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 names.append(path)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
843 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
844 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845 opts = self.options['global'] + self.options['add']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 recurse = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
847 force = "--force" in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
848 ignore = "--ignore" in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
849 client = self.getClient()
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
850 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
851 self.tr('Adding directory trees to the Subversion repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
852 "add{0}{1} {2}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
853 force and " --force" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
854 ignore and " --ignore" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
855 " ".join(names)),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
856 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
858 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
859 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
860 client.add(names, recurse=recurse, force=force, ignore=ignore)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
861 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
862 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
864 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
867 def vcsRemove(self, name, project=False, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
869 Public method used to remove a file/directory from the Subversion
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
870 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
872 The default operation is to remove the local copy as well.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
873
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
874 @param name file/directory name to be removed (string or list of
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
875 strings))
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
876 @param project flag indicating deletion of a project tree (boolean)
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
877 (not needed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
878 @param noDialog flag indicating quiet operations
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
879 @return flag indicating successfull operation (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
880 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
881 if not isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
882 name = [name]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
883 opts = self.options['global'] + self.options['remove']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
884 force = "--force" in opts or noDialog
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
885 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
886 if not noDialog:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
887 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
888 self.tr('Removing files/directories from the Subversion'
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
889 ' repository'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
890 "remove{0} {1}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
891 force and " --force" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
892 " ".join(name)),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
893 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
894 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
895 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
896 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
897 client.remove(name, force=force)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
898 res = True
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
899 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
900 res = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
901 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
902 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
903 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
904 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
905 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
906
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
907 return res
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
908
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
909 def vcsMove(self, name, project, target=None, noDialog=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
910 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
911 Public method used to move a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
912
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
913 @param name file/directory name to be moved (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
914 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
915 @param target new name of the file/directory (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
916 @param noDialog flag indicating quiet operations
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
917 @return flag indicating successfull operation (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
918 """
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
919 rx_prot = re.compile('(file:|svn:|svn+ssh:|http:|https:).+')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 opts = self.options['global']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
921 res = False
169
a03768260179 Fixed a serious bug in the subversion plug-ins and in the project browser model and corrected some source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 110
diff changeset
922
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
923 if noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
924 if target is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
925 return False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
926 force = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
927 accepted = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 else:
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
929 from .SvnCopyDialog import SvnCopyDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
930 dlg = SvnCopyDialog(name, None, True, "--force" in opts)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
931 accepted = (dlg.exec() == QDialog.DialogCode.Accepted)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
932 if accepted:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 target, force = dlg.getData()
3598
37fdb72a2388 Fixed an issue in the Subversion vcsMove method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
934 if not target:
37fdb72a2388 Fixed an issue in the Subversion vcsMove method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
935 return False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
937 isDir = (os.path.isdir(name) if rx_prot.fullmatch(target) is None
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
938 else False)
169
a03768260179 Fixed a serious bug in the subversion plug-ins and in the project browser model and corrected some source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 110
diff changeset
939
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 if accepted:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941 client = self.getClient()
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
942 if rx_prot.fullmatch(target) is not None:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
943 target = self.__svnURL(target)
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
944 log = "Moving {0} to {1}".format(name, target)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
945 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
946 log = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
947 target = target
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
948 if not noDialog:
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
949 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
950 self.tr('Moving {0}').format(name),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
951 "move{0}{1} {2} {3}".format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
952 force and " --force" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
953 log and (" --message {0}".format(log)) or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
954 name, target),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
955 client, log=log)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
956 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
957 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
958 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
959 client.move(name, target, force=force)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
960 res = True
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
961 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
962 res = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
963 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
964 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965 if not noDialog:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
966 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
967 dlg.exec()
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
968 if res and rx_prot.fullmatch(target) is None:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
969 if target.startswith(project.getProjectPath()):
169
a03768260179 Fixed a serious bug in the subversion plug-ins and in the project browser model and corrected some source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 110
diff changeset
970 if isDir:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
971 project.moveDirectory(name, target)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
972 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
973 project.renameFileInPdata(name, target)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
974 else:
169
a03768260179 Fixed a serious bug in the subversion plug-ins and in the project browser model and corrected some source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 110
diff changeset
975 if isDir:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
976 project.removeDirectory(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
977 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
978 project.removeFile(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
979 return res
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
980
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
981 def vcsDiff(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
982 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
983 Public method used to view the difference of a file/directory to the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
984 Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
985
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
986 If name is a directory and is the project directory, all project files
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3024
diff changeset
987 are saved first. If name is a file (or list of files), which is/are
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
988 being edited and has unsaved modification, they can be saved or the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
989 operation may be aborted.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
990
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
991 @param name file/directory name to be diffed (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
992 """
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
993 names = name[:] if isinstance(name, list) else [name]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
994 for nam in names:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
995 if os.path.isfile(nam):
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
996 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
997 if editor and not editor.checkDirty():
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
998 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
999 else:
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
1000 project = e5App().getObject("Project")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1001 if nam == project.ppath and not project.saveAllScripts():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1002 return
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1003 if self.diff is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1004 from .SvnDiffDialog import SvnDiffDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1005 self.diff = SvnDiffDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1006 self.diff.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1007 self.diff.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1008 QApplication.processEvents()
4072
46fb585f60f2 Extended the diff dialogs of the various VCS interfaces to allow a refresh in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
1009 self.diff.start(name, refreshable=True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1010
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1011 def vcsStatus(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1012 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1013 Public method used to view the status of files/directories in the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1014 Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1015
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1016 @param name file/directory name(s) to show the status of
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1017 (string or list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1018 """
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1019 if self.status is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1020 from .SvnStatusDialog import SvnStatusDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1021 self.status = SvnStatusDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1022 self.status.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1023 self.status.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1024 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1025 self.status.start(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1026
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1027 def vcsTag(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1028 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1029 Public method used to set the tag of a file/directory in the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1030 Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1031
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1032 @param name file/directory name to be tagged (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1033 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1034 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1035
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1036 reposURL = self.svnGetReposName(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1037 if reposURL is None:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1038 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1039 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1040 self.tr("Subversion Error"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1041 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1042 """The URL of the project repository could not be"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1043 """ retrieved from the working copy. The tag operation"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1044 """ will be aborted"""))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1045 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1046
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1047 if self.otherData["standardLayout"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1048 url = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1049 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1050 url = self.svnNormalizeURL(reposURL)
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1051 from .SvnTagDialog import SvnTagDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1052 dlg = SvnTagDialog(self.allTagsBranchesList, url,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1053 self.otherData["standardLayout"])
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1054 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1055 tag, tagOp = dlg.getParameters()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1056 if tag in self.allTagsBranchesList:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1057 self.allTagsBranchesList.remove(tag)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1058 self.allTagsBranchesList.insert(0, tag)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1059 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1060 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1061
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1062 if self.otherData["standardLayout"]:
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1063 rx_base = re.compile('(.+)/(trunk|tags|branches).*')
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1064
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1065 match = rx_base.fullmatch(reposURL)
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1066 if match is None:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1067 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1068 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1069 self.tr("Subversion Error"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1070 self.tr(
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1071 """The URL of the project repository has an"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1072 """ invalid format. The tag operation will"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1073 """ be aborted"""))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1074 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1075
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1076 reposRoot = match.group(1)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1077 if tagOp in [1, 4]:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
1078 url = '{0}/tags/{1}'.format(reposRoot, quote(tag))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1079 elif tagOp in [2, 8]:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
1080 url = '{0}/branches/{1}'.format(reposRoot, quote(tag))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1081 else:
6
52e8c820d0dd Removed some superfluous unicode() calls.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1082 url = self.__svnURL(tag)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1083
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1084 self.tagName = tag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1085 client = self.getClient()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1086 rev = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1087 if tagOp in [1, 2]:
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
1088 log = 'Created tag <{0}>'.format(self.tagName)
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1089 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1090 self.tr('Tagging {0} in the Subversion repository')
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1091 .format(name),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1092 "copy --message {0} {1} {2}".format(log, reposURL, url),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1093 client, log=log)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1094 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1095 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1096 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1097 rev = client.copy(reposURL, url)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1098 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1099 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1100 else:
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
1101 log = 'Deleted tag <{0}>'.format(self.tagName)
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1102 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1103 self.tr('Tagging {0} in the Subversion repository')
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1104 .format(name),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1105 "remove --message {0} {1}".format(log, url),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1106 client, log=log)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1107 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1108 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1109 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1110 rev = client.remove(url)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1111 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1112 dlg.showError(e.args[0])
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
1113 rev and dlg.showMessage(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1114 self.tr("Revision {0}.\n").format(rev.number))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1115 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1116 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1117
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1118 def vcsRevert(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1119 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1120 Public method used to revert changes made to a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1121
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1122 @param name file/directory name to be reverted (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1123 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1124 recurse = False
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1125 if not isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1126 name = [name]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1127 if os.path.isdir(name[0]):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1128 recurse = True
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1129
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1130 project = e5App().getObject("Project")
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1131 names = [project.getRelativePath(nam) for nam in name]
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1132 if names[0]:
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1133 from UI.DeleteFilesConfirmationDialog import (
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1134 DeleteFilesConfirmationDialog
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1135 )
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1136 dia = DeleteFilesConfirmationDialog(
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1137 self.parent(),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1138 self.tr("Revert changes"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1139 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1140 "Do you really want to revert all changes to these files"
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1141 " or directories?"),
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1142 name)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1143 yes = dia.exec() == QDialog.DialogCode.Accepted
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1144 else:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1145 yes = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1146 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1147 self.tr("Revert changes"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1148 self.tr("""Do you really want to revert all changes of"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1149 """ the project?"""))
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1150 if yes:
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1151 client = self.getClient()
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1152 dlg = SvnDialog(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1153 self.tr('Reverting changes'),
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1154 "revert {0} {1}".format(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1155 (not recurse) and " --non-recursive" or "",
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1156 " ".join(name)),
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1157 client)
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1158 QApplication.processEvents()
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1159 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1160 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1161 client.revert(name, recurse)
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1162 except pysvn.ClientError as e:
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1163 dlg.showError(e.args[0])
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1164 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1165 dlg.exec()
2352
21971ebfaaef Added a confirmation dialog to the 'revert' VCS actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2318
diff changeset
1166 self.checkVCSStatus()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1167
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1168 def vcsSwitch(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1169 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1170 Public method used to switch a directory to a different tag/branch.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1171
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1172 @param name directory name to be switched (string)
1083
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1173 @return flag indicating, that the switch contained an add
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1174 or delete (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1175 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1176 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1177
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1178 reposURL = self.svnGetReposName(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1179 if reposURL is None:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1180 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1181 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1182 self.tr("Subversion Error"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1183 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1184 """The URL of the project repository could not be"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1185 """ retrieved from the working copy. The switch"""
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1186 """ operation will be aborted"""))
1083
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1187 return False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1188
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1189 if self.otherData["standardLayout"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1190 url = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1191 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1192 url = self.svnNormalizeURL(reposURL)
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1193 from .SvnSwitchDialog import SvnSwitchDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1194 dlg = SvnSwitchDialog(self.allTagsBranchesList, url,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1195 self.otherData["standardLayout"])
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1196 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1197 tag, tagType = dlg.getParameters()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1198 if tag in self.allTagsBranchesList:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1199 self.allTagsBranchesList.remove(tag)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1200 self.allTagsBranchesList.insert(0, tag)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1201 else:
1083
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1202 return False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1203
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1204 if self.otherData["standardLayout"]:
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1205 rx_base = re.compile('(.+)/(trunk|tags|branches).*')
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1206 match = rx_base.fullmatch(reposURL)
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1207 if match is None:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1208 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1209 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1210 self.tr("Subversion Error"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1211 self.tr(
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1212 """The URL of the project repository has an"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1213 """ invalid format. The switch operation will"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1214 """ be aborted"""))
1083
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1215 return False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1216
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1217 reposRoot = match.group(1)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1218 tn = tag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1219 if tagType == 1:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
1220 url = '{0}/tags/{1}'.format(reposRoot, quote(tag))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1221 elif tagType == 2:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
1222 url = '{0}/branches/{1}'.format(reposRoot, quote(tag))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1223 elif tagType == 4:
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
1224 url = '{0}/trunk'.format(reposRoot)
110
c9a969db1469 Fixed doc string still containing QString and QStringList.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 96
diff changeset
1225 tn = 'HEAD'
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1226 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1227 url = self.__svnURL(tag)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1228 tn = url
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1229
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1230 client = self.getClient()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1231 dlg = SvnDialog(self.tr('Switching to {0}').format(tn),
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1232 "switch {0} {1}".format(url, name),
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1233 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1234 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1235 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1236 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1237 rev = client.switch(name, url)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1238 dlg.showMessage(self.tr("Revision {0}.\n").format(rev.number))
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1239 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1240 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1241 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1242 dlg.exec()
1083
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1243 res = dlg.hasAddOrDelete()
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1244 self.checkVCSStatus()
dc680a0ce221 Extended the code logic for the switch command of the various version control interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1245 return res
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1246
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1247 def vcsMerge(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1248 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1249 Public method used to merge a URL/revision into the local project.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1250
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1251 @param name file/directory name to be merged (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1252 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1253 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1254
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1255 opts = self.options['global']
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1256 from .SvnMergeDialog import SvnMergeDialog
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1257 dlg = SvnMergeDialog(self.mergeList[0], self.mergeList[1],
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1258 self.mergeList[2], "--force" in opts)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1259 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1260 urlrev1, urlrev2, target, force = dlg.getParameters()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1261 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1262 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1263
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1264 # remember URL or revision
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1265 if urlrev1 in self.mergeList[0]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1266 self.mergeList[0].remove(urlrev1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1267 self.mergeList[0].insert(0, urlrev1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1268 if urlrev2 in self.mergeList[1]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1269 self.mergeList[1].remove(urlrev2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1270 self.mergeList[1].insert(0, urlrev2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1271
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1272 rx_rev = re.compile('\\d+|HEAD|head')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1273
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1274 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1275 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1276 recurse = "--non-recursive" not in opts
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1277 if bool(rx_rev.fullmatch(urlrev1)):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1278 if urlrev1 in ["HEAD", "head"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1279 revision1 = pysvn.Revision(pysvn.opt_revision_kind.head)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1280 rev1 = "HEAD"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1281 else:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1282 revision1 = pysvn.Revision(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1283 pysvn.opt_revision_kind.number, int(urlrev1))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1284 rev1 = urlrev1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1285 if urlrev2 in ["HEAD", "head"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1286 revision2 = pysvn.Revision(pysvn.opt_revision_kind.head)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1287 rev2 = "HEAD"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1288 else:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1289 revision2 = pysvn.Revision(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1290 pysvn.opt_revision_kind.number, int(urlrev2))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1291 rev2 = urlrev2
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1292 if not target:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1293 url1 = name
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1294 url2 = name
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1295 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1296 url1 = target
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1297 url2 = target
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1298
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1299 # remember target
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1300 if target in self.mergeList[2]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1301 self.mergeList[2].remove(target)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1302 self.mergeList[2].insert(0, target)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1303 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1304 if "@" in urlrev1:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1305 url1, rev = urlrev1.split("@")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1306 if rev in ["HEAD", "head"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1307 revision1 = pysvn.Revision(pysvn.opt_revision_kind.head)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1308 rev1 = "HEAD"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1309 else:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1310 revision1 = pysvn.Revision(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1311 pysvn.opt_revision_kind.number, int(rev))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1312 rev1 = rev
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1313 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1314 url1 = urlrev1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1315 revision1 = pysvn.Revision(pysvn.opt_revision_kind.unspecified)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1316 rev1 = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1317 if "@" in urlrev2:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1318 url2, rev = urlrev2.split("@")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1319 if rev in ["HEAD", "head"]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1320 revision2 = pysvn.Revision(pysvn.opt_revision_kind.head)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1321 rev2 = "HEAD"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1322 else:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1323 revision2 = pysvn.Revision(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1324 pysvn.opt_revision_kind.number, int(rev))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1325 rev2 = rev
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1326 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1327 url2 = urlrev2
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1328 revision2 = pysvn.Revision(pysvn.opt_revision_kind.unspecified)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1329 rev2 = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1330 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1331 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1332 self.tr('Merging {0}').format(name),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1333 "merge{0}{1} {2} {3} {4}".format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1334 (not recurse) and " --non-recursive" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1335 force and " --force" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1336 "{0}{1}".format(url1, rev1 and ("@" + rev1) or ""),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1337 "{0}{1}".format(url2, rev2 and ("@" + rev2) or ""),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1338 fname),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1339 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1340 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1341 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1342 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1343 client.merge(url1, revision1, url2, revision2, fname,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1344 recurse=recurse, force=force)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1345 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1346 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1347 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1348 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1349 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1350
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1351 def vcsRegisteredState(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1352 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1353 Public method used to get the registered state of a file in the vcs.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1354
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1355 @param name filename to check (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1356 @return a combination of canBeCommited and canBeAdded
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1357 """
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1358 if self.__wcng:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1359 return self.__vcsRegisteredState_wcng(name)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1360 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1361 return self.__vcsRegisteredState_wc(name)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1362
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1363 def __vcsRegisteredState_wcng(self, name):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1364 """
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1365 Private method used to get the registered state of a file in the vcs.
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1366
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1367 This is the variant for subversion installations using the new
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1368 working copy meta-data format.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1369
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1370 @param name filename to check (string)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1371 @return a combination of canBeCommited and canBeAdded
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1372 """
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1373 if name.endswith(os.sep):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1374 name = name[:-1]
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1375 name = os.path.normcase(name)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1376 dname, fname = self.splitPath(name)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1377
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1378 if fname == '.' and os.path.isdir(os.path.join(dname, self.adminDir)):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1379 return self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1380
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1381 if name in self.statusCache:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1382 return self.statusCache[name]
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1383
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1384 name = os.path.normcase(name)
1588
dccffd13be8d Did some PEP-8 related corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1576
diff changeset
1385 states = {name: 0}
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1386 states = self.vcsAllRegisteredStates(states, dname, False)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1387 if states[name] == self.canBeCommitted:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1388 return self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1389 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1390 return self.canBeAdded
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1391
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1392 def __vcsRegisteredState_wc(self, name):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1393 """
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1394 Private method used to get the registered state of a file in the vcs.
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1395
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1396 This is the variant for subversion installations using the old working
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1397 copy meta-data format.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1398
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1399 @param name filename to check (string)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1400 @return a combination of canBeCommited and canBeAdded
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1401 """
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1402 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1403
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1404 if fname == '.':
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1405 if os.path.isdir(os.path.join(dname, self.adminDir)):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1406 return self.canBeCommitted
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1407 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1408 return self.canBeAdded
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1409
6
52e8c820d0dd Removed some superfluous unicode() calls.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1410 name = os.path.normcase(name)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1411 states = {name: 0}
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1412 states = self.vcsAllRegisteredStates(states, dname, False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1413 if states[name] == self.canBeCommitted:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1414 return self.canBeCommitted
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1415 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1416 return self.canBeAdded
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1417
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1418 def vcsAllRegisteredStates(self, names, dname, shortcut=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1419 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1420 Public method used to get the registered states of a number of files
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1421 in the vcs.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1422
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1423 <b>Note:</b> If a shortcut is to be taken, the code will only check,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1424 if the named directory has been scanned already. If so, it is assumed,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1425 that the states for all files has been populated by the previous run.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1426
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1427 @param names dictionary with all filenames to be checked as keys
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1428 @param dname directory to check in (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1429 @param shortcut flag indicating a shortcut should be taken (boolean)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1430 @return the received dictionary completed with a combination of
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1431 canBeCommited and canBeAdded or None in order to signal an error
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1432 """
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1433 if self.__wcng:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1434 return self.__vcsAllRegisteredStates_wcng(names, dname, shortcut)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1435 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1436 return self.__vcsAllRegisteredStates_wc(names, dname, shortcut)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1437
1588
dccffd13be8d Did some PEP-8 related corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1576
diff changeset
1438 def __vcsAllRegisteredStates_wcng(self, names, dname, shortcut=True):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1439 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1440 Private method used to get the registered states of a number of files
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1441 in the vcs.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1442
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1443 This is the variant for subversion installations using the new working
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1444 copy meta-data format.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1445
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1446 <b>Note:</b> If a shortcut is to be taken, the code will only check,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1447 if the named directory has been scanned already. If so, it is assumed,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1448 that the states for all files has been populated by the previous run.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1449
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1450 @param names dictionary with all filenames to be checked as keys
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1451 @param dname directory to check in (string)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1452 @param shortcut flag indicating a shortcut should be taken (boolean)
1588
dccffd13be8d Did some PEP-8 related corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1576
diff changeset
1453 @return the received dictionary completed with a combination of
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1454 canBeCommited and canBeAdded or None in order to signal an error
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1455 """
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1456 if dname.endswith(os.sep):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1457 dname = dname[:-1]
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1458 dname = os.path.normcase(dname)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1459
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1460 found = False
8205
4a0f1f896341 Applied some code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
1461 for name in self.statusCache:
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1462 if name in names:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1463 found = True
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1464 names[name] = self.statusCache[name]
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1465
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1466 if not found:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1467 # find the root of the repo
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1468 repodir = dname
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1469 while not os.path.isdir(os.path.join(repodir, self.adminDir)):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1470 repodir = os.path.dirname(repodir)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1471 if os.path.splitdrive(repodir)[1] == os.sep:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1472 return names
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1473
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1474 from .SvnDialogMixin import SvnDialogMixin
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1475 mixin = SvnDialogMixin()
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1476 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1477 client.callback_get_login = mixin._clientLoginCallback
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1478 client.callback_ssl_server_trust_prompt = (
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1479 mixin._clientSslServerTrustPromptCallback
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1480 )
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1481
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1482 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1483 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1484 allFiles = client.status(dname, recurse=True, get_all=True,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1485 ignore=True, update=False)
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1486 dirs = [x for x in names.keys() if os.path.isdir(x)]
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1487 for file in allFiles:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1488 name = os.path.normcase(file.path)
3128
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1489 if self.__isVersioned(file):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1490 if name in names:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1491 names[name] = self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1492 dn = name
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1493 while (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1494 os.path.splitdrive(dn)[1] != os.sep and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1495 dn != repodir
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1496 ):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1497 dn = os.path.dirname(dn)
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1498 if (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1499 dn in self.statusCache and
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1500 self.statusCache[dn] ==
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1501 self.canBeCommitted
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1502 ):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1503 break
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1504 self.statusCache[dn] = self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1505 self.statusCache[name] = self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1506 if dirs:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1507 for d in dirs:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1508 if name.startswith(d):
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1509 names[d] = self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1510 self.statusCache[d] = self.canBeCommitted
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1511 dirs.remove(d)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1512 break
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1513 else:
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1514 self.statusCache[name] = self.canBeAdded
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1515 except pysvn.ClientError:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1516 # ignore pysvn errors
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1517 pass
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1518
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1519 return names
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1520
1588
dccffd13be8d Did some PEP-8 related corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1576
diff changeset
1521 def __vcsAllRegisteredStates_wc(self, names, dname, shortcut=True):
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1522 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1523 Private method used to get the registered states of a number of files
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1524 in the VCS.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1525
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1526 This is the variant for subversion installations using the old working
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1527 copy meta-data format.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1528
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1529 <b>Note:</b> If a shortcut is to be taken, the code will only check,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1530 if the named directory has been scanned already. If so, it is assumed,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1531 that the states for all files has been populated by the previous run.
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1532
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1533 @param names dictionary with all filenames to be checked as keys
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1534 @param dname directory to check in (string)
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1535 @param shortcut flag indicating a shortcut should be taken (boolean)
1588
dccffd13be8d Did some PEP-8 related corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1576
diff changeset
1536 @return the received dictionary completed with a combination of
1576
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1537 canBeCommited and canBeAdded or None in order to signal an error
72e5b4b8bad7 Changed code to make the subversion plug-ins compatible with the new generation working copy meta-data format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
1538 """
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1539 if not os.path.isdir(os.path.join(dname, self.adminDir)):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1540 # not under version control -> do nothing
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1541 return names
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1542
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1543 found = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1544 for name in self.statusCache:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1545 if os.path.dirname(name) == dname:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1546 if shortcut:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1547 found = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1548 break
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1549 if name in names:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1550 found = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1551 names[name] = self.statusCache[name]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1552
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1553 if not found:
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1554 from .SvnDialogMixin import SvnDialogMixin
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1555 mixin = SvnDialogMixin()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1556 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1557 client.callback_get_login = mixin._clientLoginCallback
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1558 client.callback_ssl_server_trust_prompt = (
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1559 mixin._clientSslServerTrustPromptCallback
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1560 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1561
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1562 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1563 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1564 allFiles = client.status(dname, recurse=True, get_all=True,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1565 ignore=True, update=False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1566 for file in allFiles:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1567 name = os.path.normcase(file.path)
3128
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1568 if self.__isVersioned(file):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1569 if name in names:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1570 names[name] = self.canBeCommitted
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1571 self.statusCache[name] = self.canBeCommitted
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1572 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1573 self.statusCache[name] = self.canBeAdded
96
9624a110667d Started to clean up the code supported by py3flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 87
diff changeset
1574 except pysvn.ClientError:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1575 # ignore pysvn errors
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1576 pass
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1577
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1578 return names
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1579
3128
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1580 def __isVersioned(self, status):
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1581 """
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1582 Private method to check, if the given status indicates a
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1583 versioned state.
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1584
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1585 @param status status object to check (pysvn.PysvnStatus)
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1586 @return flag indicating a versioned state (boolean)
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1587 """
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1588 return status["text_status"] in [
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1589 pysvn.wc_status_kind.normal,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1590 pysvn.wc_status_kind.added,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1591 pysvn.wc_status_kind.missing,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1592 pysvn.wc_status_kind.deleted,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1593 pysvn.wc_status_kind.replaced,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1594 pysvn.wc_status_kind.modified,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1595 pysvn.wc_status_kind.merged,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1596 pysvn.wc_status_kind.conflicted,
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1597 ]
2d4ccc459f7e Implemented a workaround for a bug in recent pysvn versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3108
diff changeset
1598
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1599 def clearStatusCache(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1600 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1601 Public method to clear the status cache.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1602 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1603 self.statusCache = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1604
1880
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1605 def vcsInitConfig(self, project):
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1606 """
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1607 Public method to initialize the VCS configuration.
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1608
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1609 This method ensures, that eric specific files and directories are
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1610 ignored.
1880
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1611
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1612 @param project reference to the project (Project)
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1613 """
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1614 configPath = getConfigPath()
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1615 if os.path.exists(configPath):
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1616 amendConfig()
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1617 else:
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1618 createDefaultConfig()
dbd4d7698310 Added code to ensure, that some eric specific files and directories get ignored
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1837
diff changeset
1619
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1620 def vcsName(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1621 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1622 Public method returning the name of the vcs.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1623
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1624 @return always 'Subversion' (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1625 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1626 return "Subversion"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1627
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1628 def vcsCleanup(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1629 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1630 Public method used to cleanup the working copy.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1631
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1632 @param name directory name to be cleaned up (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1633 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1634 client = self.getClient()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1635 dlg = SvnDialog(self.tr('Cleaning up {0}').format(name),
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1636 "cleanup {0}".format(name),
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1637 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1638 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1639 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1640 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1641 client.cleanup(name)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1642 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1643 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1644 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1645 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1646
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1647 def vcsCommandLine(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1648 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1649 Public method used to execute arbitrary subversion commands.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1650
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1651 @param name directory name of the working directory (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1652 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1653 from .SvnCommandDialog import SvnCommandDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1654 dlg = SvnCommandDialog(self.commandHistory, self.wdHistory, name)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1655 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1656 command, wd = dlg.getData()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1657 commandList = Utilities.parseOptionString(command)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1658
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1659 # This moves any previous occurrence of these arguments to the head
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1660 # of the list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1661 if command in self.commandHistory:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1662 self.commandHistory.remove(command)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1663 self.commandHistory.insert(0, command)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1664 if wd in self.wdHistory:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1665 self.wdHistory.remove(wd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1666 self.wdHistory.insert(0, wd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1667
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1668 args = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1669 self.addArguments(args, commandList)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1670
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1671 from Plugins.VcsPlugins.vcsSubversion.SvnDialog import (
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1672 SvnDialog as SvnProcessDialog
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1673 )
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1674 dia = SvnProcessDialog(self.tr('Subversion command'))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1675 res = dia.startProcess(args, wd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1676 if res:
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1677 dia.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1678
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1679 def vcsOptionsDialog(self, project, archive, editable=False, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1680 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1681 Public method to get a dialog to enter repository info.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1682
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1683 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1684 @param archive name of the project in the repository (string)
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1685 @param editable flag indicating that the project name is editable
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1686 (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1687 @param parent parent widget (QWidget)
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1688 @return reference to the instantiated options dialog (SvnOptionsDialog)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1689 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1690 from .SvnOptionsDialog import SvnOptionsDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1691 return SvnOptionsDialog(self, project, parent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1692
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1693 def vcsNewProjectOptionsDialog(self, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1694 """
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1695 Public method to get a dialog to enter repository info for getting a
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1696 new project.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1697
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1698 @param parent parent widget (QWidget)
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1699 @return reference to the instantiated options dialog
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
1700 (SvnNewProjectOptionsDialog)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1701 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1702 from .SvnNewProjectOptionsDialog import SvnNewProjectOptionsDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1703 return SvnNewProjectOptionsDialog(self, parent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1704
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1705 def vcsRepositoryInfos(self, ppath):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1706 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1707 Public method to retrieve information about the repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1708
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1709 @param ppath local path to get the repository infos (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1710 @return string with ready formated info for display (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1711 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1712 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1713 entry = self.getClient().info(ppath)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1714 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1715 return e.args[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1716
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1717 if hasattr(pysvn, 'svn_api_version'):
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
1718 apiVersion = "{0} {1}".format(
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1719 ".".join([str(v) for v in pysvn.svn_api_version[:3]]),
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
1720 pysvn.svn_api_version[3])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1721 else:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
1722 apiVersion = QCoreApplication.translate('subversion', "unknown")
3141
72f3bde98c58 SVN/ PySVN plugins fixed. urllib.quote wrapper for unicode characters added. SBS diff fixed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3060
diff changeset
1723
72f3bde98c58 SVN/ PySVN plugins fixed. urllib.quote wrapper for unicode characters added. SBS diff fixed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3060
diff changeset
1724 hmsz = time.strftime("%H:%M:%S %Z", time.localtime(entry.commit_time))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
1725 return QCoreApplication.translate(
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1726 'subversion',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1727 """<h3>Repository information</h3>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1728 """<table>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1729 """<tr><td><b>PySvn V.</b></td><td>{0}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1730 """<tr><td><b>Subversion V.</b></td><td>{1}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1731 """<tr><td><b>Subversion API V.</b></td><td>{2}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1732 """<tr><td><b>URL</b></td><td>{3}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1733 """<tr><td><b>Current revision</b></td><td>{4}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1734 """<tr><td><b>Committed revision</b></td><td>{5}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1735 """<tr><td><b>Committed date</b></td><td>{6}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1736 """<tr><td><b>Comitted time</b></td><td>{7}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1737 """<tr><td><b>Last author</b></td><td>{8}</td></tr>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1738 """</table>"""
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1739 ).format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1740 ".".join([str(v) for v in pysvn.version]),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1741 ".".join([str(v) for v in pysvn.svn_version[:3]]),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1742 apiVersion,
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1743 entry.url,
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1744 entry.revision.number,
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1745 entry.commit_revision.number,
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1746 time.strftime(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1747 "%Y-%m-%d", time.localtime(entry.commit_time)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1748 hmsz,
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1749 entry.commit_author
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1750 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1751
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1752 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1753 ## Public Subversion specific methods are below.
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1754 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1755
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1756 def svnGetReposName(self, path):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1757 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1758 Public method used to retrieve the URL of the subversion repository
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1759 path.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1760
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1761 @param path local path to get the svn repository path for (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1762 @return string with the repository path URL
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1763 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1764 client = pysvn.Client()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1765 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1766 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1767 entry = client.info(path)
96
9624a110667d Started to clean up the code supported by py3flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 87
diff changeset
1768 url = entry.url
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1769 except pysvn.ClientError:
418
a13fe26c57a4 Fixed a bug in the subversion plugins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 248
diff changeset
1770 url = ""
96
9624a110667d Started to clean up the code supported by py3flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 87
diff changeset
1771 return url
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1772
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1773 def svnResolve(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1774 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1775 Public method used to resolve conflicts of a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1776
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1777 @param name file/directory name to be resolved (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1778 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1779 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1780 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1781 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1782 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1783 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1784
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1785 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1786 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1787 opts = self.options['global']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1788 recurse = "--non-recursive" not in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1789 client = self.getClient()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1790 dlg = SvnDialog(self.tr('Resolving conficts'),
3024
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1791 "resolved{0} {1}".format(
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1792 (not recurse) and " --non-recursive" or "",
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1793 " ".join(fnames)),
17c01303a239 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1794 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1795 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1796 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1797 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1798 for name in fnames:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1799 client.resolved(name, recurse=recurse)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1800 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1801 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1802 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1803 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1804 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1805 self.checkVCSStatus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1806
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1807 def svnCopy(self, name, project):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1808 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1809 Public method used to copy a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1810
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1811 @param name file/directory name to be copied (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1812 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1813 @return flag indicating successfull operation (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1814 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1815 from .SvnCopyDialog import SvnCopyDialog
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1816 rx_prot = re.compile('(file:|svn:|svn+ssh:|http:|https:).+')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1817 dlg = SvnCopyDialog(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1818 res = False
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1819 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1820 target, force = dlg.getData()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1821
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1822 client = self.getClient()
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1823 if bool(rx_prot.fullmatch(target)):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1824 target = self.__svnURL(target)
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
1825 log = "Copying {0} to {1}".format(name, target)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1826 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1827 log = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1828 target = target
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1829 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1830 self.tr('Copying {0}').format(name),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1831 "copy{0} {1} {2}".format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1832 log and (" --message {0}".format(log)) or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1833 name, target),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1834 client, log=log)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1835 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1836 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1837 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1838 client.copy(name, target)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1839 res = True
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1840 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1841 res = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1842 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1843 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1844 dlg.exec()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1845 if (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1846 res and
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7774
diff changeset
1847 not bool(rx_prot.fullmatch(target)) and
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1848 target.startswith(project.getProjectPath())
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1849 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1850 if os.path.isdir(name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1851 project.copyDirectory(name, target)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1852 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1853 project.appendFile(target)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1854 return res
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1855
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1856 def svnListProps(self, name, recursive=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1857 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1858 Public method used to list the properties of a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1859
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1860 @param name file/directory name (string or list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1861 @param recursive flag indicating a recursive list is requested
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1862 """
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1863 if self.propList is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1864 from .SvnPropListDialog import SvnPropListDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1865 self.propList = SvnPropListDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1866 self.propList.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1867 self.propList.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1868 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1869 self.propList.start(name, recursive)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1870
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1871 def svnSetProp(self, name, recursive=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1872 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1873 Public method used to add a property to a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1874
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1875 @param name file/directory name (string or list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1876 @param recursive flag indicating a recursive set is requested
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1877 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1878 from .SvnPropSetDialog import SvnPropSetDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1879 dlg = SvnPropSetDialog(recursive)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1880 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1881 propName, propValue, recurse = dlg.getData()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1882 if not propName:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1883 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1884 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1885 self.tr("Subversion Set Property"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1886 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1887 """You have to supply a property name. Aborting."""))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1888 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1889
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1890 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1891 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1892 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1893 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1894 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1895
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1896 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1897 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1898 opts = self.options['global']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1899 skipchecks = "--skip-checks" in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1900 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1901 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1902 self.tr('Subversion Set Property'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1903 "propset{0}{1} {2} {3} {4}".format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1904 recurse and " --recurse" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1905 skipchecks and " --skip-checks" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1906 propName, propValue,
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1907 " ".join(fnames)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1908 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1909 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1910 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1911 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1912 for name in fnames:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1913 client.propset(propName, propValue, name,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1914 recurse=recurse, skip_checks=skipchecks)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1915 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1916 dlg.showError(e.args[0])
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1917 dlg.showMessage(self.tr("Property set."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1918 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1919 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1920 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1921
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1922 def svnDelProp(self, name, recursive=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1923 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1924 Public method used to delete a property of a file/directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1925
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1926 @param name file/directory name (string or list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1927 @param recursive flag indicating a recursive list is requested
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1928 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
1929 from .SvnPropDelDialog import SvnPropDelDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1930 dlg = SvnPropDelDialog(recursive)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
1931 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1932 propName, recurse = dlg.getData()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1933
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1934 if not propName:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1935 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
1936 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1937 self.tr("Subversion Delete Property"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1938 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
1939 """You have to supply a property name. Aborting."""))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1940 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1941
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1942 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1943 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1944 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1945 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1946 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1947
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1948 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1949 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1950 opts = self.options['global']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1951 skipchecks = "--skip-checks" in opts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1952 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1953 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1954 self.tr('Subversion Delete Property'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1955 "propdel{0}{1} {2} {3}".format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1956 recurse and " --recurse" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1957 skipchecks and " --skip-checks" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1958 propName, " ".join(fnames)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1959 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1960 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1961 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1962 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1963 for name in fnames:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1964 client.propdel(propName, name,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
1965 recurse=recurse, skip_checks=skipchecks)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
1966 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1967 dlg.showError(e.args[0])
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1968 dlg.showMessage(self.tr("Property deleted."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1969 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
1970 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1971 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1972
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1973 def svnListTagBranch(self, path, tags=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1974 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1975 Public method used to list the available tags or branches.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1976
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1977 @param path directory name of the project (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1978 @param tags flag indicating listing of branches or tags
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1979 (False = branches, True = tags)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1980 """
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1981 if self.tagbranchList is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1982 from .SvnTagBranchListDialog import SvnTagBranchListDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1983 self.tagbranchList = SvnTagBranchListDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1984 self.tagbranchList.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
1985 self.tagbranchList.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1986 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1987 res = self.tagbranchList.start(path, tags)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1988 if res:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1989 if tags:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1990 self.tagsList = self.tagbranchList.getTagList()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1991 if not self.showedTags:
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1992 self.allTagsBranchesList = (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1993 self.allTagsBranchesList +
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1994 self.tagsList
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1995 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1996 self.showedTags = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1997 elif not tags:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1998 self.branchesList = self.tagbranchList.getTagList()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1999 if not self.showedBranches:
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2000 self.allTagsBranchesList = (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2001 self.allTagsBranchesList +
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2002 self.branchesList
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2003 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2004 self.showedBranches = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2005
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2006 def svnBlame(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2007 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2008 Public method to show the output of the svn blame command.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2009
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2010 @param name file name to show the blame for (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2011 """
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2012 if self.blame is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2013 from .SvnBlameDialog import SvnBlameDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2014 self.blame = SvnBlameDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2015 self.blame.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2016 self.blame.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2017 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2018 self.blame.start(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2019
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2020 def svnExtendedDiff(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2021 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2022 Public method used to view the difference of a file/directory to the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2023 Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2024
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2025 If name is a directory and is the project directory, all project files
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2026 are saved first. If name is a file (or list of files), which is/are
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2027 being edited and has unsaved modification, they can be saved or the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2028 operation may be aborted.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2029
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2030 This method gives the chance to enter the revisions to be compared.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2031
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2032 @param name file/directory name to be diffed (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2033 """
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
2034 names = name[:] if isinstance(name, list) else [name]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2035 for nam in names:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2036 if os.path.isfile(nam):
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
2037 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2038 if editor and not editor.checkDirty():
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2039 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2040 else:
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
2041 project = e5App().getObject("Project")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2042 if nam == project.ppath and not project.saveAllScripts():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2043 return
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2044 from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2045 dlg = SvnRevisionSelectionDialog()
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2046 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2047 revisions = dlg.getRevisions()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2048 if self.diff is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2049 from .SvnDiffDialog import SvnDiffDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2050 self.diff = SvnDiffDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2051 self.diff.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2052 self.diff.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2053 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2054 self.diff.start(name, revisions)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2055
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2056 def svnUrlDiff(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2057 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2058 Public method used to view the difference of a file/directory of two
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2059 repository URLs.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2060
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2061 If name is a directory and is the project directory, all project files
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2062 are saved first. If name is a file (or list of files), which is/are
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2063 being edited and has unsaved modification, they can be saved or the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2064 operation may be aborted.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2065
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2066 This method gives the chance to enter the revisions to be compared.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2067
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2068 @param name file/directory name to be diffed (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2069 """
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
2070 names = name[:] if isinstance(name, list) else [name]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2071 for nam in names:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2072 if os.path.isfile(nam):
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
2073 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2074 if editor and not editor.checkDirty():
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2075 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2076 else:
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
2077 project = e5App().getObject("Project")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2078 if nam == project.ppath and not project.saveAllScripts():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2079 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2080
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2081 dname = self.splitPath(names[0])[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2082
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2083 from .SvnUrlSelectionDialog import SvnUrlSelectionDialog
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2084 dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2085 dname)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2086 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2087 urls, summary = dlg.getURLs()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2088 if self.diff is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2089 from .SvnDiffDialog import SvnDiffDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2090 self.diff = SvnDiffDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2091 self.diff.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2092 self.diff.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2093 QApplication.processEvents()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2094 self.diff.start(name, urls=urls, summary=summary)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2095
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2096 def __svnGetFileForRevision(self, name, rev=""):
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2097 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2098 Private method to get a file for a specific revision from the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2099 repository.
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2100
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2101 @param name file name to get from the repository (string)
7900
72b88fb20261 Corrected the use of '@keyparam' in the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7836
diff changeset
2102 @param rev revision to retrieve (integer or string)
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2103 @return contents of the file (string) and an error message (string)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2104 """
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2105 output = ""
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2106 error = ""
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2107
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2108 client = self.getClient()
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2109 try:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2110 if rev:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2111 if isinstance(rev, int) or rev.isdecimal():
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2112 rev = pysvn.Revision(
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2113 pysvn.opt_revision_kind.number, int(rev))
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2114 elif rev.startswith("{"):
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2115 dateStr = rev[1:-1]
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2116 secs = QDateTime.fromString(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2117 dateStr, Qt.DateFormat.ISODate).toTime_t()
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2118 rev = pysvn.Revision(pysvn.opt_revision_kind.date, secs)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2119 elif rev == "HEAD":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2120 rev = pysvn.Revision(pysvn.opt_revision_kind.head)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2121 elif rev == "COMMITTED":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2122 rev = pysvn.Revision(pysvn.opt_revision_kind.committed)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2123 elif rev == "BASE":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2124 rev = pysvn.Revision(pysvn.opt_revision_kind.base)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2125 elif rev == "WORKING":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2126 rev = pysvn.Revision(pysvn.opt_revision_kind.working)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2127 elif rev == "PREV":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2128 rev = pysvn.Revision(pysvn.opt_revision_kind.previous)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2129 else:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2130 rev = pysvn.Revision(pysvn.opt_revision_kind.unspecified)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2131 output = client.cat(name, revision=rev)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2132 else:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2133 output = client.cat(name)
3141
72f3bde98c58 SVN/ PySVN plugins fixed. urllib.quote wrapper for unicode characters added. SBS diff fixed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3060
diff changeset
2134 output = output.decode('utf-8')
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2135 except pysvn.ClientError as e:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2136 error = str(e)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2137
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2138 return output, error
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2139
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2140 def svnSbsDiff(self, name, extended=False, revisions=None):
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2141 """
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2142 Public method used to view the difference of a file to the Mercurial
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2143 repository side-by-side.
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2144
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2145 @param name file name to be diffed (string)
7900
72b88fb20261 Corrected the use of '@keyparam' in the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7836
diff changeset
2146 @param extended flag indicating the extended variant (boolean)
72b88fb20261 Corrected the use of '@keyparam' in the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7836
diff changeset
2147 @param revisions tuple of two revisions (tuple of strings)
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2148 @exception ValueError raised to indicate an invalid name parameter type
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2149 """
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2150 if isinstance(name, list):
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2151 raise ValueError("Wrong parameter type")
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2152
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2153 if extended:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2154 from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2155 dlg = SvnRevisionSelectionDialog()
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2156 if dlg.exec() == QDialog.DialogCode.Accepted:
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2157 rev1, rev2 = dlg.getRevisions()
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2158 if rev1 == "WORKING":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2159 rev1 = ""
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2160 if rev2 == "WORKING":
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2161 rev2 = ""
5593
0f61eae74237 Avoid exception on aborting the extended side by side diff.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5452
diff changeset
2162 else:
0f61eae74237 Avoid exception on aborting the extended side by side diff.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5452
diff changeset
2163 return
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2164 elif revisions:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2165 rev1, rev2 = revisions[0], revisions[1]
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2166 else:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2167 rev1, rev2 = "", ""
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2168
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2169 output1, error = self.__svnGetFileForRevision(name, rev=rev1)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2170 if error:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
2171 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
2172 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2173 self.tr("Subversion Side-by-Side Difference"),
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2174 error)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2175 return
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2176 name1 = "{0} (rev. {1})".format(name, rev1 and rev1 or ".")
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2177
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2178 if rev2:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2179 output2, error = self.__svnGetFileForRevision(name, rev=rev2)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2180 if error:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
2181 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
2182 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2183 self.tr("Subversion Side-by-Side Difference"),
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2184 error)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2185 return
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2186 name2 = "{0} (rev. {1})".format(name, rev2)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2187 else:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2188 try:
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7775
diff changeset
2189 with open(name, "r", encoding="utf-8") as f1:
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7775
diff changeset
2190 output2 = f1.read()
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2191 name2 = name
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7785
diff changeset
2192 except OSError:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
2193 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3009
diff changeset
2194 self.__ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2195 self.tr("Subversion Side-by-Side Difference"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2196 self.tr(
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2197 """<p>The file <b>{0}</b> could not be read.</p>""")
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
2198 .format(name))
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2199 return
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2200
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2201 if self.sbsDiff is None:
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2202 from UI.CompareDialog import CompareDialog
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2203 self.sbsDiff = CompareDialog()
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2204 self.sbsDiff.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2205 self.sbsDiff.raise_()
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2206 self.sbsDiff.compare(output1, output2, name1, name2)
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2207
3349
2a034a7f1f54 Made the status LED (right lower corner) clickable (depending on overall VCS status it will show the log browser or the status dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3287
diff changeset
2208 def vcsLogBrowser(self, name, isFile=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2209 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2210 Public method used to browse the log of a file/directory from the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2211 Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2212
3349
2a034a7f1f54 Made the status LED (right lower corner) clickable (depending on overall VCS status it will show the log browser or the status dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3287
diff changeset
2213 @param name file/directory name to show the log of (string)
2845
7e55c6268c35 Added capability to compare files side-by-side to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2842
diff changeset
2214 @param isFile flag indicating log for a file is to be shown (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2215 """
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
2216 if self.logBrowser is None:
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
2217 from .SvnLogBrowserDialog import SvnLogBrowserDialog
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
2218 self.logBrowser = SvnLogBrowserDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2219 self.logBrowser.show()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2220 self.logBrowser.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2221 QApplication.processEvents()
3349
2a034a7f1f54 Made the status LED (right lower corner) clickable (depending on overall VCS status it will show the log browser or the status dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3287
diff changeset
2222 self.logBrowser.start(name, isFile=isFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2223
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2224 def svnLock(self, name, stealIt=False, parent=None):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2225 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2226 Public method used to lock a file in the Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2227
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2228 @param name file/directory name to be locked (string or list of
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2229 strings)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2230 @param stealIt flag indicating a forced operation (boolean)
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2231 @param parent reference to the parent object of the subversion dialog
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2232 (QWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2233 """
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
2234 comment, ok = QInputDialog.getText(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2235 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2236 self.tr("Subversion Lock"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2237 self.tr("Enter lock comment"),
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2238 QLineEdit.EchoMode.Normal)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2239
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2240 if not ok:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2241 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2242
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2243 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2244 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2245 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2246 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2247 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2248
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2249 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2250 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2251 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2252 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2253 self.tr('Locking in the Subversion repository'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2254 "lock{0}{1} {2}".format(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2255 stealIt and " --force" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2256 comment and (" --message {0}".format(comment)) or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2257 " ".join(fnames)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2258 client, parent=parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2259 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2260 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2261 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2262 client.lock(fnames, comment, force=stealIt)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2263 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2264 dlg.showError(e.args[0])
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2265 except AttributeError as e:
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2266 dlg.showError(str(e))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2267 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2268 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2269 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2270
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2271 def svnUnlock(self, name, breakIt=False, parent=None):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2272 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2273 Public method used to unlock a file in the Subversion repository.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2274
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2275 @param name file/directory name to be unlocked (string or list of
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2276 strings)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2277 @param breakIt flag indicating a forced operation (boolean)
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2278 @param parent reference to the parent object of the subversion dialog
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2279 (QWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2280 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2281 if isinstance(name, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2282 dname, fnames = self.splitPathList(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2283 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2284 dname, fname = self.splitPath(name)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2285 fnames = [fname]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2286
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2287 cwd = os.getcwd()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2288 os.chdir(dname)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2289 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2290 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2291 self.tr('Unlocking in the Subversion repository'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2292 "unlock{0} {1}".format(breakIt and " --force" or "",
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2293 " ".join(fnames)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2294 client, parent=parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2295 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2296 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2297 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2298 client.unlock(fnames, force=breakIt)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2299 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2300 dlg.showError(e.args[0])
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2301 except AttributeError as e:
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2302 dlg.showError(str(e))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2303 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2304 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2305 os.chdir(cwd)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2306
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2307 def svnInfo(self, projectPath, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2308 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2309 Public method to show repository information about a file or directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2310
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2311 @param projectPath path name of the project (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2312 @param name file/directory name relative to the project (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2313 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2314 from .SvnInfoDialog import SvnInfoDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2315 dlg = SvnInfoDialog(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2316 dlg.start(projectPath, name)
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2317 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2318
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2319 def svnRelocate(self, projectPath):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2320 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2321 Public method to relocate the working copy to a new repository URL.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2322
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2323 @param projectPath path name of the project (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2324 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2325 from .SvnRelocateDialog import SvnRelocateDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2326 currUrl = self.svnGetReposName(projectPath)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2327 dlg = SvnRelocateDialog(currUrl)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2328 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2329 newUrl, inside = dlg.getData()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2330 if inside:
424
d0915392cbd7 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 418
diff changeset
2331 msg = "switch {0} {1}".format(newUrl, projectPath)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2332 else:
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2333 msg = "relocate {0} {1} {2}".format(currUrl, newUrl,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2334 projectPath)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2335 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2336 dlg = SvnDialog(self.tr('Relocating'), msg, client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2337 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2338 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2339 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2340 if inside:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2341 client.switch(projectPath, newUrl)
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2342 else:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2343 client.relocate(currUrl, newUrl, projectPath,
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2344 recurse=True)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2345 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2346 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2347 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2348 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2349
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2350 def svnRepoBrowser(self, projectPath=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2351 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2352 Public method to open the repository browser.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2353
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2354 @param projectPath path name of the project (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2355 """
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
2356 url = self.svnGetReposName(projectPath) if projectPath else None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2357 if url is None:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
2358 url, ok = QInputDialog.getText(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2359 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2360 self.tr("Repository Browser"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2361 self.tr("Enter the repository URL."),
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
2362 QLineEdit.EchoMode.Normal)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2363 if not ok or not url:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2364 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2365
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2366 if self.repoBrowser is None:
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2367 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2368 self.repoBrowser = SvnRepoBrowserDialog(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2369 self.repoBrowser.start(url)
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2370 self.repoBrowser.show()
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
2371 self.repoBrowser.raise_()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2372
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2373 def svnRemoveFromChangelist(self, names):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2374 """
2763
e4794166ad70 Fixed a serious typo.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2451
diff changeset
2375 Public method to remove a file or directory from its changelist.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2376
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2377 Note: Directories will be removed recursively.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2378
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2379 @param names name or list of names of file or directory to remove
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2380 (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2381 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2382 if not isinstance(names, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2383 names = [names]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2384 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2385 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2386 self.tr('Remove from changelist'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2387 "changelist --remove {0}".format(" ".join(names)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2388 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2389 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2390 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2391 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2392 for name in names:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2393 client.remove_from_changelists(name)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2394 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2395 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2396 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2397 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2398
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2399 def svnAddToChangelist(self, names):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2400 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2401 Public method to add a file or directory to a changelist.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2402
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2403 Note: Directories will be added recursively.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2404
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2405 @param names name or list of names of file or directory to add
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2406 (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2407 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2408 if not isinstance(names, list):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2409 names = [names]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2410
1888
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2411 clname, ok = QInputDialog.getItem(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2412 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2413 self.tr("Add to changelist"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
2414 self.tr("Enter name of the changelist:"),
1888
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2415 sorted(self.svnGetChangelists()),
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2416 0, True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2417 if not ok or not clname:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2418 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2419
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2420 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2421 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2422 self.tr('Add to changelist'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2423 "changelist {0}".format(" ".join(names)),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2424 client)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2425 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2426 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2427 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2428 for name in names:
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2429 client.add_to_changelist(
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2430 name, clname, depth=pysvn.depth.infinity)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6
diff changeset
2431 except pysvn.ClientError as e:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2432 dlg.showError(e.args[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2433 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2434 dlg.exec()
1883
2de804dc1452 Added a TODO for improving changelists handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1880
diff changeset
2435
1888
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2436 def svnShowChangelists(self, path):
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2437 """
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2438 Public method used to inspect the change lists defined for the project.
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2439
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2440 @param path directory name to show change lists for (string)
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2441 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2442 from .SvnChangeListsDialog import SvnChangeListsDialog
1888
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2443 self.changeLists = SvnChangeListsDialog(self)
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2444 self.changeLists.show()
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2445 QApplication.processEvents()
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2446 self.changeLists.start(path)
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2447
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2448 def svnGetChangelists(self):
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2449 """
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2450 Public method to get a list of all defined change lists.
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2451
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2452 @return list of defined change list names (list of strings)
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2453 """
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2454 changelists = []
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2455 client = self.getClient()
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2456 if hasattr(client, 'get_changelist'):
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2457 ppath = e5App().getObject("Project").getProjectPath()
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2458 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2459 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2460 entries = client.get_changelist(
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2461 ppath, depth=pysvn.depth.infinity)
1888
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2462 for entry in entries:
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2463 changelist = entry[1]
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2464 if changelist not in changelists:
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2465 changelists.append(changelist)
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2466 except pysvn.ClientError:
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2467 pass
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2468
03f59d88a62d Added capability to select from existing change lists and added a dialog to browse the change lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1883
diff changeset
2469 return changelists
3108
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2470
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2471 def svnUpgrade(self, path):
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2472 """
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2473 Public method to upgrade the working copy format.
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2474
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2475 @param path directory name to show change lists for (string)
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2476 """
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2477 client = self.getClient()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2478 dlg = SvnDialog(
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2479 self.tr('Upgrade'),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2480 "upgrade {0}".format(path),
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2481 client)
3108
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2482 QApplication.processEvents()
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2483 try:
7774
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2484 with E5MutexLocker(self.vcsExecutionMutex):
9eed155411f0 Changed code to our own context manager type mutex locker class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
2485 client.upgrade(path)
3108
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2486 except pysvn.ClientError as e:
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2487 dlg.showError(e.args[0])
30521d7d3101 Added cabaility to upgrade the working copy format to the Subversion interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3051
diff changeset
2488 dlg.finish()
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7639
diff changeset
2489 dlg.exec()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2490
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2491 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2492 ## Private Subversion specific methods are below.
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2493 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2494
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2495 def __svnURL(self, url):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2496 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2497 Private method to format a url for subversion.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2498
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2499 @param url unformatted url string (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2500 @return properly formated url for subversion (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2501 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2502 url = self.svnNormalizeURL(url)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2503 url = url.split(':', 2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2504 if len(url) == 3:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2505 scheme = url[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2506 host = url[1]
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2507 port, path = url[2].split("/", 1)
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
2508 return "{0}:{1}:{2}/{3}".format(scheme, host, port, quote(path))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2509 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2510 scheme = url[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2511 if scheme == "file":
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
2512 return "{0}:{1}".format(scheme, quote(url[1]))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2513 else:
442
f233430b5613 Fixed an issue in the Subversion plugins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 424
diff changeset
2514 try:
f233430b5613 Fixed an issue in the Subversion plugins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 424
diff changeset
2515 host, path = url[1][2:].split("/", 1)
f233430b5613 Fixed an issue in the Subversion plugins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 424
diff changeset
2516 except ValueError:
f233430b5613 Fixed an issue in the Subversion plugins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 424
diff changeset
2517 host = url[1][2:]
f233430b5613 Fixed an issue in the Subversion plugins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 424
diff changeset
2518 path = ""
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7167
diff changeset
2519 return "{0}://{1}/{2}".format(scheme, host, quote(path))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2520
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2521 def svnNormalizeURL(self, url):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2522 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2523 Public method to normalize a url for subversion.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2524
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2525 @param url url string (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2526 @return properly normalized url for subversion (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2527 """
2451
4d80de2f9122 Fixed a situation where a strange URL could lead to an issue in the subversion clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
2528 protocol, url = url.split("://", 1)
1683
ef9a9e86269e Fixed an issue with building Subversion URLs, if the path contains a Windows share path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1588
diff changeset
2529 if url.startswith("\\\\"):
ef9a9e86269e Fixed an issue with building Subversion URLs, if the path contains a Windows share path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1588
diff changeset
2530 url = url[2:]
1894
a7096cf751db Corrected the last change to the Subversion plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1890
diff changeset
2531 if protocol == "file":
a7096cf751db Corrected the last change to the Subversion plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1890
diff changeset
2532 url = os.path.normcase(url)
1898
8cc59791d781 Corrected the canonicalization routine for the PySvn plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1894
diff changeset
2533 if url[1] == ":":
8cc59791d781 Corrected the canonicalization routine for the PySvn plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1894
diff changeset
2534 url = url.replace(":", "|", 1)
1894
a7096cf751db Corrected the last change to the Subversion plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1890
diff changeset
2535 url = url.replace('\\', '/')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2536 if url.endswith('/'):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2537 url = url[:-1]
1837
36406a806be4 Fixed an issue generating Subversion URLs on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1683
diff changeset
2538 if not url.startswith("/") and url[1] in [":", "|"]:
36406a806be4 Fixed an issue generating Subversion URLs on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1683
diff changeset
2539 url = "/{0}".format(url)
1683
ef9a9e86269e Fixed an issue with building Subversion URLs, if the path contains a Windows share path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1588
diff changeset
2540 return "{0}://{1}".format(protocol, url)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2541
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2542 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2543 ## Methods to get the helper objects are below.
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2544 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2545
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2546 def vcsGetProjectBrowserHelper(self, browser, project,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2547 isTranslationsBrowser=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2548 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2549 Public method to instanciate a helper object for the different
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2550 project browsers.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2551
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2552 @param browser reference to the project browser object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2553 @param project reference to the project object
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2554 @param isTranslationsBrowser flag indicating, the helper is requested
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2555 for the translations browser (this needs some special treatment)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2556 @return the project browser helper object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2557 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2558 from .ProjectBrowserHelper import SvnProjectBrowserHelper
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2559 return SvnProjectBrowserHelper(self, browser, project,
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2560 isTranslationsBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2561
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2562 def vcsGetProjectHelper(self, project):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2563 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2564 Public method to instanciate a helper object for the project.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2565
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2566 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2567 @return the project helper object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2568 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2569 helper = self.__plugin.getProjectHelper()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2570 helper.setObjects(self, project)
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2571 self.__wcng = (
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2572 os.path.exists(
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2573 os.path.join(project.getProjectPath(), ".svn", "format")) or
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2574 os.path.exists(
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2575 os.path.join(project.getProjectPath(), "_svn", "format")) or
3051
f08c20c91de7 Extended the check for the new Subversion working copy file format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3037
diff changeset
2576 os.path.exists(
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2577 os.path.join(project.getProjectPath(), ".svn", "wc.db")) or
3051
f08c20c91de7 Extended the check for the new Subversion working copy file format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3037
diff changeset
2578 os.path.exists(
f08c20c91de7 Extended the check for the new Subversion working copy file format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3037
diff changeset
2579 os.path.join(project.getProjectPath(), "_svn", "wc.db"))
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2580 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2581 return helper
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2582
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2583 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2584 ## Status Monitor Thread methods
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2963
diff changeset
2585 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2586
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2587 def _createStatusMonitorThread(self, interval, project):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2588 """
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2589 Protected method to create an instance of the VCS status monitor
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2590 thread.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2591
2963
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2592 @param interval check interval for the monitor thread in seconds
745d38097b7f Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2845
diff changeset
2593 (integer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2594 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2595 @return reference to the monitor thread (QThread)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2596 """
2406
975af671146d Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2352
diff changeset
2597 from .SvnStatusMonitorThread import SvnStatusMonitorThread
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
2598 return SvnStatusMonitorThread(interval, project, self)

eric ide

mercurial