diff -r 2ccfb5077dd6 -r 1aa13333eb9f Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py --- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py Sun Feb 12 11:40:10 2017 +0100 +++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py Sun Feb 12 17:42:42 2017 +0100 @@ -339,6 +339,11 @@ """ the base revision and all other revision will be bundled.""" """ If the dialog is showing outgoing changesets, all""" """ selected changesets will be bundled.</p>""")) + self.__unbundleAct = self.__actionsMenu.addAction( + UI.PixmapCache.getIcon("vcsApplyChangegroup.png"), + self.tr("Apply Changegroup"), self.__unbundleActTriggered) + self.__unbundleAct.setToolTip(self.tr( + "Apply the currently viewed changegroup file")) self.__actionsMenu.addSeparator() @@ -372,8 +377,6 @@ self.actionsButton.setIcon( UI.PixmapCache.getIcon("actionsToolButton.png")) self.actionsButton.setMenu(self.__actionsMenu) - - # TODO: add action to apply viewed bundle file def __actionsMenuHovered(self, action): """ @@ -1519,6 +1522,7 @@ selectedItemsCount == 1) self.__bundleAct.setEnabled(self.logTree.topLevelItemCount() > 0) + self.__unbundleAct.setEnabled(False) self.__gpgSignAct.setEnabled( self.vcs.isExtensionActive("gpg") and @@ -1559,6 +1563,8 @@ self.__lfPullAct.setEnabled(False) self.__fetchAct.setEnabled(False) + self.__unbundleAct.setEnabled(bool(self.__bundle)) + self.actionsButton.setEnabled(True) elif self.initialCommandMode == "outgoing" and self.projectMode: @@ -1566,7 +1572,8 @@ self.__tagAct, self.__switchAct, self.__bookmarkAct, self.__bookmarkMoveAct, self.__pullAct, self.__lfPullAct, self.__fetchAct, self.__stripAct, - self.__gpgSignAct, self.__gpgVerifyAct]: + self.__gpgSignAct, self.__gpgVerifyAct, + self.__unbundleAct]: act.setEnabled(False) selectedItemsCount = len(self.logTree.selectedItems()) @@ -2351,6 +2358,26 @@ self.vcs.hgBundle(self.repodir, bundleData=bundleData) @pyqtSlot() + def __unbundleActTriggered(self): + """ + Private slot to apply the currently previewed bundle file. + """ + if self.initialCommandMode == "incoming" and bool(self.__bundle): + shouldReopen = self.vcs.hgUnbundle(self.repodir, + files=[self.__bundle]) + if shouldReopen: + res = E5MessageBox.yesNo( + None, + self.tr("Apply Changegroup"), + self.tr("""The project should be reread. Do this now?"""), + yesDefault=True) + if res: + e5App().getObject("Project").reopenProject() + return + + self.on_refreshButton_clicked() + + @pyqtSlot() def __gpgSignActTriggered(self): """ Private slot to sign the selected revisions.