eric6/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py

changeset 8108
a42ae6be4cc3
parent 7971
ff2971513d6d
child 8218
7c09585bd960
equal deleted inserted replaced
8107:7d3932bde11b 8108:a42ae6be4cc3
79 for extension in self.__extensions.values(): 79 for extension in self.__extensions.values():
80 extension.setObjects(vcsObject, projectObject) 80 extension.setObjects(vcsObject, projectObject)
81 81
82 self.vcs.iniFileChanged.connect(self.__checkActions) 82 self.vcs.iniFileChanged.connect(self.__checkActions)
83 83
84 # add Mercurial version dependent actions here
84 title = self.__toolbar.windowTitle() 85 title = self.__toolbar.windowTitle()
85 if self.vcs.version >= (3, 9): 86 if self.vcs.version >= (5, 7):
86 self.actions.append(self.hgBookmarkPullCurrentAct) 87 self.actions.append(self.hgBookmarkPushAllAct)
87 self.__toolbarManager.addAction(self.hgBookmarkPullCurrentAct, 88 self.__toolbarManager.addAction(self.hgBookmarkPushAllAct, title)
88 title)
89
90 if self.vcs.version >= (3, 8):
91 self.actions.append(self.hgBookmarkPushCurrentAct)
92 self.__toolbarManager.addAction(self.hgBookmarkPushCurrentAct,
93 title)
94 89
95 if self.vcs.version < (4, 7, 0): 90 if self.vcs.version < (4, 7, 0):
96 self.hgGraftStopAct.setEnabled(False) 91 self.hgGraftStopAct.setEnabled(False)
97 self.hgGraftAbortAct.setEnabled(False) 92 self.hgGraftAbortAct.setEnabled(False)
98 93
1269 """ repository to a remote repository.</p>""" 1264 """ repository to a remote repository.</p>"""
1270 )) 1265 ))
1271 self.hgBookmarkPushCurrentAct.triggered.connect( 1266 self.hgBookmarkPushCurrentAct.triggered.connect(
1272 self.__hgBookmarkPushCurrent) 1267 self.__hgBookmarkPushCurrent)
1273 self.actions.append(self.hgBookmarkPushCurrentAct) 1268 self.actions.append(self.hgBookmarkPushCurrentAct)
1274 1269
1270 self.hgBookmarkPushAllAct = E5Action(
1271 self.tr('Push all bookmarks'),
1272 UI.PixmapCache.getIcon("pushBookmark"),
1273 self.tr('Push all bookmarks'),
1274 0, 0, self, 'mercurial_push_all_bookmarks')
1275 self.hgBookmarkPushAllAct.setStatusTip(self.tr(
1276 'Push all bookmarks to a remote repository'
1277 ))
1278 self.hgBookmarkPushAllAct.setWhatsThis(self.tr(
1279 """<b>Push all bookmarks</b>"""
1280 """<p>This pushes all bookmark from the local"""
1281 """ repository to a remote repository.</p>"""
1282 ))
1283 self.hgBookmarkPushAllAct.triggered.connect(
1284 self.__hgBookmarkPushAll)
1285
1275 self.hgDeleteBackupsAct = E5Action( 1286 self.hgDeleteBackupsAct = E5Action(
1276 self.tr('Delete all backups'), 1287 self.tr('Delete all backups'),
1277 UI.PixmapCache.getIcon("clearPrivateData"), 1288 UI.PixmapCache.getIcon("clearPrivateData"),
1278 self.tr('Delete all backups'), 1289 self.tr('Delete all backups'),
1279 0, 0, self, 'mercurial_delete_all_backups') 1290 0, 0, self, 'mercurial_delete_all_backups')
1295 """ 1306 """
1296 self.hgPullAct.setEnabled(self.vcs.canPull()) 1307 self.hgPullAct.setEnabled(self.vcs.canPull())
1297 self.hgIncomingAct.setEnabled(self.vcs.canPull()) 1308 self.hgIncomingAct.setEnabled(self.vcs.canPull())
1298 self.hgBookmarkPullAct.setEnabled(self.vcs.canPull()) 1309 self.hgBookmarkPullAct.setEnabled(self.vcs.canPull())
1299 self.hgBookmarkIncomingAct.setEnabled(self.vcs.canPull()) 1310 self.hgBookmarkIncomingAct.setEnabled(self.vcs.canPull())
1300 if self.vcs.version >= (3, 9): 1311 self.hgBookmarkPullCurrentAct.setEnabled(self.vcs.canPull())
1301 self.hgBookmarkPullCurrentAct.setEnabled(self.vcs.canPull())
1302 1312
1303 self.hgPushAct.setEnabled(self.vcs.canPush()) 1313 self.hgPushAct.setEnabled(self.vcs.canPush())
1304 self.hgPushBranchAct.setEnabled(self.vcs.canPush()) 1314 self.hgPushBranchAct.setEnabled(self.vcs.canPush())
1305 self.hgPushForcedAct.setEnabled(self.vcs.canPush()) 1315 self.hgPushForcedAct.setEnabled(self.vcs.canPush())
1306 self.hgOutgoingAct.setEnabled(self.vcs.canPush()) 1316 self.hgOutgoingAct.setEnabled(self.vcs.canPush())
1307 self.hgBookmarkPushAct.setEnabled(self.vcs.canPush()) 1317 self.hgBookmarkPushAct.setEnabled(self.vcs.canPush())
1308 self.hgBookmarkOutgoingAct.setEnabled(self.vcs.canPush()) 1318 self.hgBookmarkOutgoingAct.setEnabled(self.vcs.canPush())
1309 if self.vcs.version >= (3, 8): 1319 self.hgBookmarkPushCurrentAct.setEnabled(self.vcs.canPush())
1310 self.hgBookmarkPushCurrentAct.setEnabled(self.vcs.canPull()) 1320 if self.vcs.version >= (5, 7):
1321 self.hgBookmarkPushAllAct.setEnabled(self.vcs.canPush())
1322
1311 self.hgCommitMergeAct.setEnabled(self.vcs.canCommitMerge()) 1323 self.hgCommitMergeAct.setEnabled(self.vcs.canCommitMerge())
1312 1324
1313 def initMenu(self, menu): 1325 def initMenu(self, menu):
1314 """ 1326 """
1315 Public method to generate the VCS menu. 1327 Public method to generate the VCS menu.
1401 bookmarksMenu.addSeparator() 1413 bookmarksMenu.addSeparator()
1402 bookmarksMenu.addAction(self.hgBookmarksListAct) 1414 bookmarksMenu.addAction(self.hgBookmarksListAct)
1403 bookmarksMenu.addSeparator() 1415 bookmarksMenu.addSeparator()
1404 bookmarksMenu.addAction(self.hgBookmarkIncomingAct) 1416 bookmarksMenu.addAction(self.hgBookmarkIncomingAct)
1405 bookmarksMenu.addAction(self.hgBookmarkPullAct) 1417 bookmarksMenu.addAction(self.hgBookmarkPullAct)
1406 if self.vcs.version >= (3, 9): 1418 bookmarksMenu.addAction(self.hgBookmarkPullCurrentAct)
1407 bookmarksMenu.addAction(self.hgBookmarkPullCurrentAct)
1408 bookmarksMenu.addSeparator() 1419 bookmarksMenu.addSeparator()
1409 bookmarksMenu.addAction(self.hgBookmarkOutgoingAct) 1420 bookmarksMenu.addAction(self.hgBookmarkOutgoingAct)
1410 bookmarksMenu.addAction(self.hgBookmarkPushAct) 1421 bookmarksMenu.addAction(self.hgBookmarkPushAct)
1411 if self.vcs.version >= (3, 8): 1422 bookmarksMenu.addAction(self.hgBookmarkPushCurrentAct)
1412 bookmarksMenu.addAction(self.hgBookmarkPushCurrentAct) 1423 if self.vcs.version >= (5, 7):
1424 bookmarksMenu.addAction(self.hgBookmarkPushAllAct)
1413 self.subMenus.append(bookmarksMenu) 1425 self.subMenus.append(bookmarksMenu)
1414 1426
1415 self.__extensionsMenu = QMenu(self.tr("Extensions"), menu) 1427 self.__extensionsMenu = QMenu(self.tr("Extensions"), menu)
1416 self.__extensionsMenu.setTearOffEnabled(True) 1428 self.__extensionsMenu.setTearOffEnabled(True)
1417 self.__extensionsMenu.aboutToShow.connect(self.__showExtensionMenu) 1429 self.__extensionsMenu.aboutToShow.connect(self.__showExtensionMenu)
2094 """ 2106 """
2095 Private slot used to push the current bookmark to a remote repository. 2107 Private slot used to push the current bookmark to a remote repository.
2096 """ 2108 """
2097 self.vcs.hgBookmarkPush(current=True) 2109 self.vcs.hgBookmarkPush(current=True)
2098 2110
2111 def __hgBookmarkPushAll(self):
2112 """
2113 Private slot to push all bookmarks to a remote repository.
2114 """
2115 self.vcs.hgBookmarkPush(allBookmarks=True)
2116
2099 def __hgDeleteBackups(self): 2117 def __hgDeleteBackups(self):
2100 """ 2118 """
2101 Private slot used to delete all backup bundles. 2119 Private slot used to delete all backup bundles.
2102 """ 2120 """
2103 self.vcs.hgDeleteBackups() 2121 self.vcs.hgDeleteBackups()

eric ide

mercurial