Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 5091
dfac14826e78
parent 4631
5c1a96925da4
child 5104
0b9420dc1093
diff -r 700fc0934424 -r dfac14826e78 Plugins/VcsPlugins/vcsMercurial/hg.py
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Wed Aug 10 16:23:08 2016 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Thu Aug 11 16:13:37 2016 +0200
@@ -3804,11 +3804,14 @@
         
         return bookmarksList
     
-    def hgBookmarkPull(self, name):
+    def hgBookmarkPull(self, name, current=False):
         """
         Public method to pull a bookmark from a remote repository.
         
-        @param name file/directory name (string)
+        @param name file/directory name
+        @type str
+        @param current flag indicating to pull the current bookmark
+        @type bool
         """
         # find the root of the repo
         repodir = self.splitPath(name)[0]
@@ -3817,14 +3820,18 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
-        bookmarks = self.__getInOutBookmarks(repodir, True)
-        
-        bookmark, ok = QInputDialog.getItem(
-            None,
-            self.tr("Pull Bookmark"),
-            self.tr("Select the bookmark to be pulled:"),
-            [""] + sorted(bookmarks),
-            0, True)
+        if current:
+            bookmark = "."
+            ok = True
+        else:
+            bookmarks = self.__getInOutBookmarks(repodir, True)
+            
+            bookmark, ok = QInputDialog.getItem(
+                None,
+                self.tr("Pull Bookmark"),
+                self.tr("Select the bookmark to be pulled:"),
+                [""] + sorted(bookmarks),
+                0, True)
         if ok and bookmark:
             args = self.initCommand("pull")
             args.append('--bookmark')
@@ -3837,11 +3844,14 @@
             if res:
                 dia.exec_()
     
-    def hgBookmarkPush(self, name):
+    def hgBookmarkPush(self, name, current=False):
         """
         Public method to push a bookmark to a remote repository.
         
-        @param name file/directory name (string)
+        @param name file/directory name
+        @type str
+        @param current flag indicating to push the current bookmark
+        @type bool
         """
         # find the root of the repo
         repodir = self.splitPath(name)[0]
@@ -3850,14 +3860,18 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
-        bookmarks = self.__getInOutBookmarks(repodir, False)
-        
-        bookmark, ok = QInputDialog.getItem(
-            None,
-            self.tr("Push Bookmark"),
-            self.tr("Select the bookmark to be push:"),
-            [""] + sorted(bookmarks),
-            0, True)
+        if current:
+            bookmark = "."
+            ok = True
+        else:
+            bookmarks = self.__getInOutBookmarks(repodir, False)
+            
+            bookmark, ok = QInputDialog.getItem(
+                None,
+                self.tr("Push Bookmark"),
+                self.tr("Select the bookmark to be push:"),
+                [""] + sorted(bookmarks),
+                0, True)
         if ok and bookmark:
             args = self.initCommand("push")
             args.append('--bookmark')

eric ide

mercurial