eric6/Plugins/VcsPlugins/vcsMercurial/HgRepoConfigDataDialog.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 7780
41420f82c0ac
child 8143
2c730d5fd177
permissions
-rw-r--r--

Updated copyright for 2021.

3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2010 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4543
2e6a880670e9 Fixed a few code style issues (forgotten future imports, copyrights,...).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
4 #
2e6a880670e9 Fixed a few code style issues (forgotten future imports, copyrights,...).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
5
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to enter data needed for the initial creation
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 of a repository configuration file (hgrc).
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
11 from PyQt5.QtCore import pyqtSlot, QUrl
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
12 from PyQt5.QtWidgets import QDialog, QLineEdit
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from .Ui_HgRepoConfigDataDialog import Ui_HgRepoConfigDataDialog
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import UI.PixmapCache
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
18 from .LargefilesExtension import getDefaults as getLargefilesDefaults
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
19
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 class HgRepoConfigDataDialog(QDialog, Ui_HgRepoConfigDataDialog):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Class implementing a dialog to enter data needed for the initial creation
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 of a repository configuration file (hgrc).
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
26 def __init__(self, withLargefiles=False, largefilesData=None, parent=None):
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
30 @param withLargefiles flag indicating to configure the largefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
31 section (boolean)
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
32 @param largefilesData dictionary with data for the largefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
33 section (dict)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param parent reference to the parent widget (QWidget)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3311
diff changeset
36 super(HgRepoConfigDataDialog, self).__init__(parent)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.setupUi(self)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.defaultShowPasswordButton.setIcon(
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: 7360
diff changeset
40 UI.PixmapCache.getIcon("showPassword"))
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.defaultPushShowPasswordButton.setIcon(
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: 7360
diff changeset
42 UI.PixmapCache.getIcon("showPassword"))
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
44 self.__withLargefiles = withLargefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
45 if withLargefiles:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
46 if largefilesData is None:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
47 largefilesData = getLargefilesDefaults()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
48 self.lfFileSizeSpinBox.setValue(largefilesData["minsize"])
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
49 self.lfFilePatternsEdit.setText(
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
50 " ".join(largefilesData["pattern"]))
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
51 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
52 self.largefilesGroup.setVisible(False)
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
53
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.resize(self.width(), self.minimumSizeHint().height())
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 @pyqtSlot(bool)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 def on_defaultShowPasswordButton_clicked(self, checked):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 Private slot to switch the default password visibility
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 of the default password.
3246
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
61
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
62 @param checked state of the push button (boolean)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 if checked:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.defaultPasswordEdit.setEchoMode(QLineEdit.Normal)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 self.defaultPasswordEdit.setEchoMode(QLineEdit.Password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 @pyqtSlot(bool)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 def on_defaultPushShowPasswordButton_clicked(self, checked):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 Private slot to switch the default password visibility
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 of the default push password.
3246
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
74
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
75 @param checked state of the push button (boolean)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 if checked:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.defaultPushPasswordEdit.setEchoMode(QLineEdit.Normal)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.defaultPushPasswordEdit.setEchoMode(QLineEdit.Password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 def getData(self):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 Public method to get the data entered into the dialog.
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 @return tuple giving the default and default push URLs (tuple of
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 two strings)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 defaultUrl = QUrl.fromUserInput(self.defaultUrlEdit.text())
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 username = self.defaultUserEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 password = self.defaultPasswordEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 if username:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 defaultUrl.setUserName(username)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 if password:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 defaultUrl.setPassword(password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 if not defaultUrl.isValid():
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 defaultUrl = ""
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 defaultUrl = defaultUrl.toString()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 defaultPushUrl = QUrl.fromUserInput(self.defaultPushUrlEdit.text())
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 username = self.defaultPushUserEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 password = self.defaultPushPasswordEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 if username:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 defaultPushUrl.setUserName(username)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 if password:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 defaultPushUrl.setPassword(password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 if not defaultPushUrl.isValid():
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 defaultPushUrl = ""
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 defaultPushUrl = defaultPushUrl.toString()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 return defaultUrl, defaultPushUrl
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
114
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
115 def getLargefilesData(self):
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
116 """
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
117 Public method to get the data for the largefiles extension.
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
118
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
119 @return tuple with the minimum file size (integer) and file patterns
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
120 (list of string). None as value denote to use the default value.
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
121 """
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
122 if self.__withLargefiles:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
123 lfDefaults = getLargefilesDefaults()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
124 if self.lfFileSizeSpinBox.value() == lfDefaults["minsize"]:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
125 minsize = None
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
126 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
127 minsize = self.lfFileSizeSpinBox.value()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
128 patterns = self.lfFilePatternsEdit.text().split()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
129 if set(patterns) == set(lfDefaults["pattern"]):
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
130 patterns = None
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
131
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
132 return minsize, patterns
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
133 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
134 return None, None

eric ide

mercurial