eric6/Plugins/VcsPlugins/vcsMercurial/hg.py

branch
maintenance
changeset 8142
43248bafe9b2
parent 8043
0acf98cd089a
parent 8108
a42ae6be4cc3
child 8176
31965986ecd1
equal deleted inserted replaced
8044:874fdd14d3a2 8142:43248bafe9b2
3224 self) 3224 self)
3225 res = dia.startProcess(args) 3225 res = dia.startProcess(args)
3226 if res: 3226 if res:
3227 dia.exec() 3227 dia.exec()
3228 3228
3229 def hgBookmarkPush(self, current=False, bookmark=None): 3229 def hgBookmarkPush(self, current=False, bookmark=None, allBookmarks=False):
3230 """ 3230 """
3231 Public method to push a bookmark to a remote repository. 3231 Public method to push a bookmark to a remote repository.
3232 3232
3233 @param current flag indicating to push the current bookmark 3233 @param current flag indicating to push the current bookmark
3234 @type bool 3234 @type bool
3235 @param bookmark name of the bookmark 3235 @param bookmark name of the bookmark
3236 @type str 3236 @type str
3237 @param allBookmarks flag indicating to push all bookmarks
3238 @type bool
3237 """ 3239 """
3238 if current: 3240 if current:
3239 bookmark = "." 3241 bookmark = "."
3240 ok = True 3242 ok = True
3241 elif bookmark: 3243 elif bookmark or allBookmarks:
3242 ok = True 3244 ok = True
3243 else: 3245 else:
3244 bookmarks = self.__getInOutBookmarks(False) 3246 bookmarks = self.__getInOutBookmarks(False)
3245 bookmark, ok = QInputDialog.getItem( 3247 bookmark, ok = QInputDialog.getItem(
3246 None, 3248 None,
3247 self.tr("Push Bookmark"), 3249 self.tr("Push Bookmark"),
3248 self.tr("Select the bookmark to be push:"), 3250 self.tr("Select the bookmark to be push:"),
3249 [""] + sorted(bookmarks), 3251 [""] + sorted(bookmarks),
3250 0, True) 3252 0, True)
3251 3253
3252 if ok and bookmark: 3254 if ok and (bool(bookmark) or all):
3253 args = self.initCommand("push") 3255 args = self.initCommand("push")
3254 args.append('--bookmark') 3256 if allBookmarks:
3255 args.append(bookmark) 3257 args.append('--all-bookmarks')
3258 else:
3259 args.append('--bookmark')
3260 args.append(bookmark)
3256 3261
3257 dia = HgDialog(self.tr( 3262 dia = HgDialog(self.tr(
3258 'Pushing bookmark to a remote Mercurial repository'), 3263 'Pushing bookmark to a remote Mercurial repository'),
3259 self) 3264 self)
3260 res = dia.startProcess(args) 3265 res = dia.startProcess(args)

eric ide

mercurial