--- a/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.py Fri Aug 03 17:56:44 2018 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/HgRebaseDialog.py Sat Aug 04 13:38:50 2018 +0200 @@ -15,12 +15,11 @@ from .Ui_HgRebaseDialog import Ui_HgRebaseDialog -# TODO: Mercurial 4.7: add support for --confirm and --dry-run flags class HgRebaseDialog(QDialog, Ui_HgRebaseDialog): """ Class implementing a dialog to enter the data for a rebase session. """ - def __init__(self, tagsList, branchesList, bookmarksList=None, + def __init__(self, tagsList, branchesList, bookmarksList, version, parent=None): """ Constructor @@ -42,14 +41,10 @@ self.tag2Combo.addItems(sorted(tagsList)) self.branch1Combo.addItems(["default"] + sorted(branchesList)) self.branch2Combo.addItems(["default"] + sorted(branchesList)) - if bookmarksList is not None: - self.bookmark1Combo.addItems(sorted(bookmarksList)) - self.bookmark2Combo.addItems(sorted(bookmarksList)) - else: - self.bookmark1Button.setHidden(True) - self.bookmark1Combo.setHidden(True) - self.bookmark2Button.setHidden(True) - self.bookmark2Combo.setHidden(True) + self.bookmark1Combo.addItems(sorted(bookmarksList)) + self.bookmark2Combo.addItems(sorted(bookmarksList)) + + self.dryRunGroup.setEnabled(version >= (4, 7, 0)) msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) @@ -276,9 +271,11 @@ @return tuple with a source indicator of "S" or "B", the source revision, the destination revision, a flag indicating to collapse, a flag indicating to keep the original changesets, a flag - indicating to keep the original branch name and a flag indicating - to detach the source (string, string, string, boolean, boolean, - boolean, boolean) + indicating to keep the original branch name, a flag indicating + to detach the source, a flag indicating to perform a dry-run only + and a flag indicating to perform a dry-run first, than ask for + confirmation + @rtype tuple of (str, str, str, bool, bool, bool, bool, bool, bool) """ if self.sourceButton.isChecked(): indicator = "S" @@ -298,5 +295,7 @@ self.collapseCheckBox.isChecked(), self.keepChangesetsCheckBox.isChecked(), self.keepBranchCheckBox.isChecked(), - self.detachCheckBox.isChecked() + self.detachCheckBox.isChecked(), + self.dryRunOnlyButton.isChecked(), + self.dryRunConfirmButton.isChecked(), )