--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py Tue Feb 16 17:12:48 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py Tue Feb 16 18:25:47 2021 +0100 @@ -242,7 +242,7 @@ @type QPoint """ itm = self.bookmarksList.itemAt(pos) - if itm is not None: + if itm is not None and self.__bookmarksDefined: menu = QMenu(self.bookmarksList) menu.addAction( UI.PixmapCache.getIcon("vcsSwitch"), @@ -263,6 +263,17 @@ UI.PixmapCache.getIcon("pushBookmark"), self.tr("Push"), self.__pushBookmark) act.setEnabled(self.vcs.canPush()) + menu.addSeparator() + act = menu.addAction( + UI.PixmapCache.getIcon("pushBookmark"), + self.tr("Push Current"), self.__pushCurrentBookmark) + act.setEnabled(self.vcs.canPush()) + if self.vcs.version >= (5, 7): + act = menu.addAction( + UI.PixmapCache.getIcon("pushBookmark"), + self.tr("Push All"), self.__pushAllBookmarks) + act.setEnabled(self.vcs.canPush()) + menu.popup(self.bookmarksList.mapToGlobal(pos)) def __switchTo(self): @@ -338,3 +349,17 @@ if bookmark: self.vcs.hgBookmarkPush(bookmark=bookmark) self.on_refreshButton_clicked() + + def __pushCurrentBookmark(self): + """ + Private slot to push the current bookmark. + """ + self.vcs.hgBookmarkPush(current=True) + self.on_refreshButton_clicked() + + def __pushAllBookmarks(self): + """ + Private slot to push all bookmarks. + """ + self.vcs.hgBookmarkPush(allBookmarks=True) + self.on_refreshButton_clicked()