Plugins/VcsPlugins/vcsMercurial/HgBundleDialog.py

changeset 5678
0aa72754d535
parent 5500
5e723c249586
child 6048
82ad8ec9548c
equal deleted inserted replaced
5677:380176c4214b 5678:0aa72754d535
18 class HgBundleDialog(QDialog, Ui_HgBundleDialog): 18 class HgBundleDialog(QDialog, Ui_HgBundleDialog):
19 """ 19 """
20 Class implementing a dialog to enter the data for a bundle operation. 20 Class implementing a dialog to enter the data for a bundle operation.
21 """ 21 """
22 def __init__(self, tagsList, branchesList, bookmarksList=None, 22 def __init__(self, tagsList, branchesList, bookmarksList=None,
23 parent=None): 23 version=(0, 0, 0), parent=None):
24 """ 24 """
25 Constructor 25 Constructor
26 26
27 @param tagsList list of tags (list of strings) 27 @param tagsList list of tags
28 @param branchesList list of branches (list of strings) 28 @type list of str
29 @param bookmarksList list of bookmarks (list of strings) 29 @param branchesList list of branches
30 @param parent parent widget (QWidget) 30 @type list of str
31 @param bookmarksList list of bookmarks
32 @type list of str
33 @param version Mercurial version info
34 @type tuple of three integers
35 @param parent parent widget
36 @type QWidget
31 """ 37 """
32 super(HgBundleDialog, self).__init__(parent) 38 super(HgBundleDialog, self).__init__(parent)
33 self.setupUi(self) 39 self.setupUi(self)
34 40
35 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 41 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
36 42
37 self.compressionCombo.addItems(["", "bzip2", "gzip", "none"]) 43 self.__version = version
44
45 bundleTypes = ["", "bzip2", "gzip", "none"]
46 if version >= (4, 1, 0):
47 bundleTypes.insert(-1, "zstd")
48 self.compressionCombo.addItems(bundleTypes)
38 self.tagCombo.addItems(sorted(tagsList)) 49 self.tagCombo.addItems(sorted(tagsList))
39 self.branchCombo.addItems(["default"] + sorted(branchesList)) 50 self.branchCombo.addItems(["default"] + sorted(branchesList))
40 if bookmarksList is not None: 51 if bookmarksList is not None:
41 self.bookmarkCombo.addItems(sorted(bookmarksList)) 52 self.bookmarkCombo.addItems(sorted(bookmarksList))
42 else: 53 else:
152 163
153 baseRevs = [rev.strip() for rev in 164 baseRevs = [rev.strip() for rev in
154 self.baseRevisionsEdit.toPlainText().strip().splitlines() 165 self.baseRevisionsEdit.toPlainText().strip().splitlines()
155 if rev.strip()] 166 if rev.strip()]
156 167
157 return (revs, baseRevs, self.compressionCombo.currentText(), 168 bundleType = self.compressionCombo.currentText()
158 self.allCheckBox.isChecked()) 169 if bundleType == "zstd":
170 bundleType += "-v2"
171
172 return (revs, baseRevs, bundleType, self.allCheckBox.isChecked())

eric ide

mercurial