eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7533
88261c96484b
child 7971
ff2971513d6d
permissions
-rw-r--r--

Updated copyright for 2021.

1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
3 # Copyright (c) 2011 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to define guards for patches.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import os
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
12 from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
13 from PyQt5.QtWidgets import (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
14 QDialog, QDialogButtonBox, QAbstractButton, QListWidgetItem
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
15 )
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 from E5Gui import E5MessageBox
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 from .Ui_HgQueuesDefineGuardsDialog import Ui_HgQueuesDefineGuardsDialog
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import UI.PixmapCache
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 class HgQueuesDefineGuardsDialog(QDialog, Ui_HgQueuesDefineGuardsDialog):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Class implementing a dialog to define guards for patches.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
1047
b41a36b201e4 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1046
diff changeset
28 def __init__(self, vcs, extension, patchesList, parent=None):
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 Constructor
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @param vcs reference to the vcs object
1047
b41a36b201e4 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1046
diff changeset
33 @param extension reference to the extension module (Queues)
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param patchesList list of patches (list of strings)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent reference to the parent widget (QWidget)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
37 super(HgQueuesDefineGuardsDialog, self).__init__(parent)
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
4278
ccd1e13cb9bd Fixed issues where dialogs could not be minimized on some desktop environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
39 self.setWindowFlags(Qt.Window)
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.vcs = vcs
1047
b41a36b201e4 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1046
diff changeset
42 self.extension = extension
1254
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
43 self.__hgClient = vcs.getClient()
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.__patches = patchesList[:]
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.patchSelector.addItems([""] + self.__patches)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7370
diff changeset
48 self.plusButton.setIcon(UI.PixmapCache.getIcon("plus"))
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7370
diff changeset
49 self.minusButton.setIcon(UI.PixmapCache.getIcon("minus"))
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.__dirtyList = False
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.__currentPatch = ""
1260
9488a3aceb0e Added code to some Mercurial dialogs to improve user experience.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
53
9488a3aceb0e Added code to some Mercurial dialogs to improve user experience.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
54 self.show()
9488a3aceb0e Added code to some Mercurial dialogs to improve user experience.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
55 QCoreApplication.processEvents()
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 def closeEvent(self, e):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
59 Protected slot implementing a close event handler.
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 @param e close event (QCloseEvent)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 """
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
63 if self.__hgClient.isExecuting():
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
64 self.__hgClient.cancel()
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 if self.__dirtyList:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
67 res = E5MessageBox.question(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
68 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
69 self.tr("Unsaved Changes"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
70 self.tr("""The guards list has been changed."""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
71 """ Shall the changes be applied?"""),
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 E5MessageBox.StandardButtons(
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
73 E5MessageBox.Apply |
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 E5MessageBox.Discard),
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 E5MessageBox.Apply)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 if res == E5MessageBox.Apply:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.__applyGuards()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 else:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.__dirtyList = False
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 e.accept()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 def start(self, path):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 Public slot to start the list command.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 @param path name of directory to be listed (string)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 dname, fname = self.vcs.splitPath(path)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 # find the root of the repo
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 repodir = dname
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 repodir = os.path.dirname(repodir)
1318
6fa303bd65d6 Fixed issues in various Mercurial files that could cause infinite loops on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1260
diff changeset
95 if os.path.splitdrive(repodir)[1] == os.sep:
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 return
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.__repodir = repodir
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.on_patchSelector_activated("")
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 @pyqtSlot(str)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 def on_patchSelector_activated(self, patch):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
104 Private slot to get the list of guards defined for the given patch
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
105 name.
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 @param patch selected patch name (empty for current patch)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 if self.__dirtyList:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
110 res = E5MessageBox.question(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
111 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
112 self.tr("Unsaved Changes"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
113 self.tr("""The guards list has been changed."""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
114 """ Shall the changes be applied?"""),
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 E5MessageBox.StandardButtons(
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
116 E5MessageBox.Apply |
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 E5MessageBox.Discard),
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 E5MessageBox.Apply)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 if res == E5MessageBox.Apply:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.__applyGuards()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 else:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.__dirtyList = False
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.guardsList.clear()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.patchNameLabel.setText("")
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.guardCombo.clear()
1047
b41a36b201e4 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1046
diff changeset
128 guardsList = self.extension.getGuardsList(self.__repodir)
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 self.guardCombo.addItems(guardsList)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.guardCombo.setEditText("")
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
132 args = self.vcs.initCommand("qguard")
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 if patch:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 args.append(patch)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
136 output = self.__hgClient.runcommand(args)[0]
1254
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
137
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
138 if output:
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
139 patchName, guards = output.split(":", 1)
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
140 self.patchNameLabel.setText(patchName)
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
141 guardsList = guards.strip().split()
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
142 for guard in guardsList:
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
143 if guard.startswith("+"):
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7370
diff changeset
144 icon = UI.PixmapCache.getIcon("plus")
1254
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
145 guard = guard[1:]
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
146 sign = "+"
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
147 elif guard.startswith("-"):
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7370
diff changeset
148 icon = UI.PixmapCache.getIcon("minus")
1254
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
149 guard = guard[1:]
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
150 sign = "-"
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
151 else:
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
152 continue
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
153 itm = QListWidgetItem(icon, guard, self.guardsList)
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
154 itm.setData(Qt.UserRole, sign)
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 self.on_guardsList_itemSelectionChanged()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 @pyqtSlot()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 def on_guardsList_itemSelectionChanged(self):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 Private slot to handle changes of the selection of guards.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 self.removeButton.setEnabled(
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 len(self.guardsList.selectedItems()) > 0)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 def __getGuard(self, guard):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 Private method to get a reference to a named guard.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 @param guard name of the guard (string)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 @return reference to the guard item (QListWidgetItem)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 items = self.guardsList.findItems(guard, Qt.MatchCaseSensitive)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 if items:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 return items[0]
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 else:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 return None
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 @pyqtSlot(str)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 def on_guardCombo_editTextChanged(self, txt):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 Private slot to handle changes of the text of the guard combo.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 @param txt contents of the guard combo line edit (string)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.addButton.setEnabled(txt != "")
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 @pyqtSlot()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 def on_addButton_clicked(self):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 Private slot to add a guard definition to the list or change it.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 guard = self.guardCombo.currentText()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 if self.plusButton.isChecked():
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 sign = "+"
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7370
diff changeset
196 icon = UI.PixmapCache.getIcon("plus")
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 else:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 sign = "-"
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7370
diff changeset
199 icon = UI.PixmapCache.getIcon("minus")
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 guardItem = self.__getGuard(guard)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 if guardItem:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 # guard already exists, remove it first
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 row = self.guardsList.row(guardItem)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 itm = self.guardsList.takeItem(row)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 del itm
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 itm = QListWidgetItem(icon, guard, self.guardsList)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 itm.setData(Qt.UserRole, sign)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 self.guardsList.sortItems()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 self.__dirtyList = True
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 @pyqtSlot()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 def on_removeButton_clicked(self):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 Private slot to remove guard definitions from the list.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 """
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
219 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
220 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
221 self.tr("Remove Guards"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
222 self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
223 """Do you really want to remove the selected guards?"""))
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 if res:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 for guardItem in self.guardsList.selectedItems():
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 row = self.guardsList.row(guardItem)
4554
f3428ddd577c Fixed a few style and coding issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4278
diff changeset
227 itm = self.guardsList.takeItem(row) # __IGNORE_WARNING__
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 del itm
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 self.__dirtyList = True
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 @pyqtSlot(QAbstractButton)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 def on_buttonBox_clicked(self, button):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 Private slot called by a button of the button box clicked.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 @param button button that was clicked (QAbstractButton)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 if button == self.buttonBox.button(QDialogButtonBox.Apply):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.__applyGuards()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 elif button == self.buttonBox.button(QDialogButtonBox.Close):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 self.close()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 @pyqtSlot()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 def __applyGuards(self):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 Private slot to apply the defined guards to the current patch.
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 """
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 if self.__dirtyList:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 guardsList = []
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 for row in range(self.guardsList.count()):
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 itm = self.guardsList.item(row)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 guard = itm.data(Qt.UserRole) + itm.text()
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 guardsList.append(guard)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
256 args = self.vcs.initCommand("qguard")
1046
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 args.append(self.patchNameLabel.text())
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 if guardsList:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 args.append("--")
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 args.extend(guardsList)
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 else:
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 args.append("--none")
5dd14be5d6a1 Continued with support for Mercurial queues extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
264 error = self.__hgClient.runcommand(args)[1]
1254
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
265
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
266 if error:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
267 E5MessageBox.warning(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
268 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
269 self.tr("Apply Guard Definitions"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
270 self.tr("""<p>The defined guards could not be"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
271 """ applied.</p><p>Reason: {0}</p>""")
3036
30c81c9e88b8 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
272 .format(error))
1254
c077fa008aae Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
273 else:
6735
31e263d49c04 Fixed some code style issues detected by the updated style checker (over-indented lines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
274 self.__dirtyList = False
31e263d49c04 Fixed some code style issues detected by the updated style checker (over-indented lines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
275 self.on_patchSelector_activated(
31e263d49c04 Fixed some code style issues detected by the updated style checker (over-indented lines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
276 self.patchNameLabel.text())

eric ide

mercurial