Tue, 18 Oct 2022 16:06:21 +0200
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8624
diff
changeset
|
3 | # Copyright (c) 2010 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the Mercurial configuration page. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
10 | import os |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
11 | |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
12 | from PyQt6.QtCore import pyqtSlot |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
14 | from eric7.EricWidgets.EricApplication import ericApp |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
15 | from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
16 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
17 | from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import ( |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
18 | ConfigurationPageBase, |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
19 | ) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | from .Ui_MercurialPage import Ui_MercurialPage |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
21 | from .. import HgUtilities |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
23 | from eric7 import Globals |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
24 | from eric7.Utilities import supportedCodecs |
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:
3256
diff
changeset
|
25 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
26 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | class MercurialPage(ConfigurationPageBase, Ui_MercurialPage): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | Class implementing the Mercurial configuration page. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
31 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | def __init__(self, plugin): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | Constructor |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
35 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | @param plugin reference to the plugin object |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
38 | super().__init__() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | self.setupUi(self) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | self.setObjectName("MercurialPage") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
41 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | self.__plugin = plugin |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
43 | |
9054
adae534abaf0
Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9016
diff
changeset
|
44 | self.hgPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
adae534abaf0
Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9016
diff
changeset
|
45 | if Globals.isWindowsPlatform(): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
46 | self.hgPicker.setFilters( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
47 | self.tr("Executable Files (*.exe);;" "All Files (*)") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
48 | ) |
9054
adae534abaf0
Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9016
diff
changeset
|
49 | else: |
adae534abaf0
Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9016
diff
changeset
|
50 | self.hgPicker.setFilters(self.tr("All Files (*)")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
51 | |
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:
3256
diff
changeset
|
52 | self.encodingComboBox.addItems(sorted(supportedCodecs)) |
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:
3256
diff
changeset
|
53 | self.encodingModeComboBox.addItems(["strict", "ignore", "replace"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
54 | |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
55 | self.installButton.setEnabled(not self.__mercurialInstalled()) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
56 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | # set initial values |
9054
adae534abaf0
Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9016
diff
changeset
|
58 | # executable override |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
59 | self.hgPicker.setText(self.__plugin.getPreferences("MercurialExecutablePath")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
60 | |
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:
3256
diff
changeset
|
61 | # global options |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
62 | index = self.encodingComboBox.findText(self.__plugin.getPreferences("Encoding")) |
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:
3256
diff
changeset
|
63 | self.encodingComboBox.setCurrentIndex(index) |
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:
3256
diff
changeset
|
64 | index = self.encodingModeComboBox.findText( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
65 | self.__plugin.getPreferences("EncodingMode") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
66 | ) |
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:
3256
diff
changeset
|
67 | self.encodingModeComboBox.setCurrentIndex(index) |
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:
3256
diff
changeset
|
68 | self.hiddenChangesetsCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
69 | self.__plugin.getPreferences("ConsiderHidden") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
70 | ) |
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:
3256
diff
changeset
|
71 | # log |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
72 | self.logSpinBox.setValue(self.__plugin.getPreferences("LogLimit")) |
5451
8ee36e8a315f
Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
73 | self.logWidthSpinBox.setValue( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
74 | self.__plugin.getPreferences("LogMessageColumnWidth") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
75 | ) |
7009
eaf5ed6ef298
Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
76 | self.startFullLogCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
77 | self.__plugin.getPreferences("LogBrowserShowFullLog") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
78 | ) |
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:
3256
diff
changeset
|
79 | # commit |
5330
381665763704
Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5292
diff
changeset
|
80 | self.commitAuthorsSpinBox.setValue( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
81 | self.__plugin.getPreferences("CommitAuthorsLimit") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
82 | ) |
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:
3256
diff
changeset
|
83 | # pull |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
84 | self.pullUpdateCheckBox.setChecked(self.__plugin.getPreferences("PullUpdate")) |
1307
9f7a056dbcc6
Modified pull such, that it will try to apply an existing changegroups file first.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
85 | self.preferUnbundleCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
86 | self.__plugin.getPreferences("PreferUnbundle") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
87 | ) |
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:
3256
diff
changeset
|
88 | # cleanup |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
89 | self.cleanupPatternEdit.setText(self.__plugin.getPreferences("CleanupPatterns")) |
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:
3256
diff
changeset
|
90 | # revert |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
91 | self.backupCheckBox.setChecked(self.__plugin.getPreferences("CreateBackup")) |
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:
3256
diff
changeset
|
92 | # merge |
3256
1a43351889d5
Aded a configuration option to enforce the useage of the internal merge tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3231
diff
changeset
|
93 | self.internalMergeCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
94 | self.__plugin.getPreferences("InternalMerge") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
95 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
96 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | def save(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | Public slot to save the Mercurial configuration. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | """ |
9054
adae534abaf0
Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9016
diff
changeset
|
101 | # executable override |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
102 | self.__plugin.setPreferences("MercurialExecutablePath", self.hgPicker.text()) |
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:
3256
diff
changeset
|
103 | # global options |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
104 | self.__plugin.setPreferences("Encoding", self.encodingComboBox.currentText()) |
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:
3256
diff
changeset
|
105 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
106 | "EncodingMode", self.encodingModeComboBox.currentText() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
107 | ) |
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:
3256
diff
changeset
|
108 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
109 | "ConsiderHidden", self.hiddenChangesetsCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
110 | ) |
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:
3256
diff
changeset
|
111 | # log |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
112 | self.__plugin.setPreferences("LogLimit", self.logSpinBox.value()) |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2810
diff
changeset
|
113 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
114 | "LogMessageColumnWidth", self.logWidthSpinBox.value() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
115 | ) |
5451
8ee36e8a315f
Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
116 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
117 | "LogBrowserShowFullLog", self.startFullLogCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
118 | ) |
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:
3256
diff
changeset
|
119 | # commit |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2810
diff
changeset
|
120 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
121 | "CommitAuthorsLimit", self.commitAuthorsSpinBox.value() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
122 | ) |
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:
3256
diff
changeset
|
123 | # pull |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
124 | self.__plugin.setPreferences("PullUpdate", self.pullUpdateCheckBox.isChecked()) |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2810
diff
changeset
|
125 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
126 | "PreferUnbundle", self.preferUnbundleCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
127 | ) |
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:
3256
diff
changeset
|
128 | # cleanup |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
129 | self.__plugin.setPreferences("CleanupPatterns", self.cleanupPatternEdit.text()) |
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:
3256
diff
changeset
|
130 | # revert |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
131 | self.__plugin.setPreferences("CreateBackup", self.backupCheckBox.isChecked()) |
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:
3256
diff
changeset
|
132 | # merge |
3256
1a43351889d5
Aded a configuration option to enforce the useage of the internal merge tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3231
diff
changeset
|
133 | self.__plugin.setPreferences( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
134 | "InternalMerge", self.internalMergeCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
135 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
136 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | @pyqtSlot() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | def on_configButton_clicked(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | """ |
1064
10bdbb173c0f
Added an entry to the Mercurial menu to edit the user configuration file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
140 | Private slot to edit the (per user) Mercurial configuration file. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | """ |
5262
235d6a030128
Continued refactoring the Mercurial user config management code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5256
diff
changeset
|
142 | from ..HgUserConfigDialog import HgUserConfigDialog |
5292
ac8b476ba122
Added support for host fingerprints in the hostsecurity section of the Mercurial configuration file (as of hg 3.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5262
diff
changeset
|
143 | from ..HgUtilities import hgVersion |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
144 | |
5292
ac8b476ba122
Added support for host fingerprints in the hostsecurity section of the Mercurial configuration file (as of hg 3.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5262
diff
changeset
|
145 | dlg = HgUserConfigDialog(version=hgVersion(self.__plugin)[1]) |
7759
51aa6c6b66f7
Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
146 | dlg.exec() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
147 | |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
148 | @pyqtSlot() |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
149 | def on_installButton_clicked(self): |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
150 | """ |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
151 | Private slot to install Mercurial alongside eric7. |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
152 | """ |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
153 | pip = ericApp().getObject("Pip") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
154 | pip.installPackages(["mercurial"], interpreter=Globals.getPythonExecutable()) |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
155 | self.installButton.setEnabled(not self.__mercurialInstalled()) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
156 | |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
157 | def __mercurialInstalled(self): |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
158 | """ |
8522
4f263b89a293
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8465
diff
changeset
|
159 | Private method to check, if Mercurial is installed alongside eric7. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
160 | |
8522
4f263b89a293
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8465
diff
changeset
|
161 | @return flag indicating an installed Mercurial executable |
4f263b89a293
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8465
diff
changeset
|
162 | @rtype bool |
8465
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
163 | """ |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
164 | hg = HgUtilities.getHgExecutable() |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
165 | # assume local installation, if the path is absolute |
59bb8fdeef1b
Mercurial: added a button to the configuration page to install Mercurial into the eric7 environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
166 | return os.path.isabs(hg) |