Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 1307
9f7a056dbcc6
parent 1283
5766284d4393
child 1311
95685f9ad9f8
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Thu Sep 08 19:38:39 2011 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Fri Sep 09 09:33:19 2011 +0200
@@ -1569,12 +1569,23 @@
         @return flag indicating, that the update contained an add
             or delete (boolean)
         """
+        if self.getPlugin().getPreferences("PreferUnbundle") and \
+           self.bundleFile and \
+           os.path.exists(self.bundleFile):
+            command = "unbundle"
+            title = self.trUtf8('Apply changegroups')
+        else:
+            command = "pull"
+            title = self.trUtf8('Pulling from a remote Mercurial repository')
+        
         args = []
-        args.append('pull')
+        args.append(command)
         self.addArguments(args, self.options['global'])
         args.append('-v')
         if self.getPlugin().getPreferences("PullUpdate"):
             args.append('--update')
+        if command == "unbundle":
+            args.append(self.bundleFile)
         
         # find the root of the repo
         repodir = self.splitPath(name)[0]
@@ -1583,11 +1594,14 @@
             if repodir == os.sep:
                 return
         
-        dia = HgDialog(self.trUtf8('Pulling from a remote Mercurial repository'), self)
+        dia = HgDialog(title, self)
         res = dia.startProcess(args, repodir)
         if res:
             dia.exec_()
             res = dia.hasAddOrDelete()
+        if command == "unbundle":
+            os.remove(self.bundleFile)
+            self.bundleFile = None
         self.checkVCSStatus()
         return res
     

eric ide

mercurial