Bug 1275437 - Added installing of Mercurial to Windows boostrapper. draft
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Thu, 26 May 2016 10:38:58 -0700
changeset 374004 4a10a70e32ccaf9e1a9b7c254e6a4791de82768c
parent 374003 2f6ea6ddd74640b679c3b594c532fb6971455111
child 374005 33f7a6fd8c535eac9a6b6ee43e5bba9829486ff9
push id19893
push userbmo:nhakkakzadeh@mozilla.com
push dateWed, 01 Jun 2016 16:36:56 +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)