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()) |