Bug 1275437 - Added installing of Mercurial to Windows boostrapper. draft
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Thu, 26 May 2016 10:38:58 -0700
changeset 374687 d5a66ea6da584605e5f184be044af1809bb93bb2
parent 374686 06c11a1371f5da8fded0384e9213455cfe332f58
child 374688 e35115f3b42d0b8de0d8882970e7064c5f46293d
push id20064
push userbmo:nhakkakzadeh@mozilla.com
push dateThu, 02 Jun 2016 19:38:21 +0000
bugs1275437
milestone49.0a1
Bug 1275437 - Added installing of Mercurial to Windows boostrapper. Added convenience method for installing from pip. Windows bootstrapper implements upgrade_mercurial to install mercurial from pip. MozReview-Commit-ID: ClqNA2NmQcc
python/mozboot/mozboot/windows.py
--- a/python/mozboot/mozboot/windows.py
+++ b/python/mozboot/mozboot/windows.py
@@ -45,16 +45,19 @@ class WindowsBootstrapper(BaseBootstrapp
         if not self.which('pacman.exe'):
             raise NotImplementedError('The Windows bootstrapper only works with msys2 with pacman. Get msys2 at '
                                       'http://msys2.github.io/')
         print 'Using an experimental bootstrapper for Windows.'
 
     def install_system_packages(self):
         self.pacman_install(*self.SYSTEM_PACKAGES)
 
+    def upgrade_mercurial(self, current):
+        self.pip_install('mercurial')
+
     def install_browser_packages(self):
         self.pacman_install(*self.BROWSER_PACKAGES)
 
     def install_mobile_android_packages(self):
         raise NotImplementedError('We do not support building Android on Windows. Sorry!')
 
     def install_mobile_android_artifact_mode_packages(self):
         raise NotImplementedError('We do not support building Android on Windows. Sorry!')
@@ -75,8 +78,13 @@ class WindowsBootstrapper(BaseBootstrapp
 
     def pacman_install(self, *packages):
         command = ['pacman', '--sync', '--needed']
         if self.no_interactive:
             command.append('--noconfirm')
 
         command.extend(packages)
         self.run(command)
+
+    def pip_install(self, *packages):
+        command = ['pip', 'install', '--upgrade']
+        command.extend(packages)
+        self.run(command)