Plugins/VcsPlugins/vcsMercurial/FetchExtension/fetch.py

changeset 5512
f148796813d4
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
--- a/Plugins/VcsPlugins/vcsMercurial/FetchExtension/fetch.py	Sat Feb 11 18:19:56 2017 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/FetchExtension/fetch.py	Sat Feb 11 19:47:41 2017 +0100
@@ -28,13 +28,20 @@
         @param vcs reference to the Mercurial vcs object
         """
         super(Fetch, self).__init__(vcs)
+        
+        self.__vcs = vcs
     
-    def hgFetch(self, name):
+    def hgFetch(self, name, revisions=None):
         """
         Public method to fetch changes from a remote repository.
         
-        @param name file/directory name (string)
-        @return flag indicating that the project should be reread (boolean)
+        @param name directory name of the project to be fetched to
+        @type str
+        @param revisions list of revisions to be pulled
+        @type list of str
+        @return flag indicating, that the update contained an add
+            or delete
+        @rtype bool
         """
         # find the root of the repo
         repodir = self.vcs.splitPath(name)[0]
@@ -45,7 +52,7 @@
         
         from .HgFetchDialog import HgFetchDialog
         res = False
-        dlg = HgFetchDialog()
+        dlg = HgFetchDialog(self.__vcs)
         if dlg.exec_() == QDialog.Accepted:
             message, switchParent = dlg.getData()
             
@@ -56,6 +63,10 @@
             if switchParent:
                 args.append("--switch-parent")
             args.append("-v")
+            if revisions:
+                for rev in revisions:
+                    args.append("--rev")
+                    args.append(rev)
             
             dia = HgDialog(
                 self.tr('Fetching from a remote Mercurial repository'),

eric ide

mercurial