hgext/fsmonitor/pywatchman/__init__.py
changeset 39831 c31ce080eb75
parent 33790 dd35abc409ee
child 41973 57264906a996
equal deleted inserted replaced
39830:874712506b07 39831:c31ce080eb75
    45     # Demandimport causes modules to be loaded lazily. Force the load now
    45     # Demandimport causes modules to be loaded lazily. Force the load now
    46     # so that we can fall back on pybser if bser doesn't exist
    46     # so that we can fall back on pybser if bser doesn't exist
    47     bser.pdu_info
    47     bser.pdu_info
    48 except ImportError:
    48 except ImportError:
    49     from . import pybser as bser
    49     from . import pybser as bser
       
    50 
       
    51 from mercurial.utils import (
       
    52     procutil,
       
    53 )
       
    54 
       
    55 from mercurial import (
       
    56     pycompat,
       
    57 )
    50 
    58 
    51 from . import (
    59 from . import (
    52     capabilities,
    60     capabilities,
    53     compat,
    61     compat,
    54     encoding,
    62     encoding,
   578             '--no-spawn',
   586             '--no-spawn',
   579             '--no-local',
   587             '--no-local',
   580             '--no-pretty',
   588             '--no-pretty',
   581             '-j',
   589             '-j',
   582         ]
   590         ]
   583         self.proc = subprocess.Popen(args,
   591         self.proc = subprocess.Popen(pycompat.rapply(procutil.tonativestr,
       
   592                                                      args),
   584                                      stdin=subprocess.PIPE,
   593                                      stdin=subprocess.PIPE,
   585                                      stdout=subprocess.PIPE)
   594                                      stdout=subprocess.PIPE)
   586         return self.proc
   595         return self.proc
   587 
   596 
   588     def readBytes(self, size):
   597     def readBytes(self, size):
   820                 # Using the flag STARTF_USESHOWWINDOW to avoid this behavior.
   829                 # Using the flag STARTF_USESHOWWINDOW to avoid this behavior.
   821                 startupinfo = subprocess.STARTUPINFO()
   830                 startupinfo = subprocess.STARTUPINFO()
   822                 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
   831                 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
   823                 args['startupinfo'] = startupinfo
   832                 args['startupinfo'] = startupinfo
   824 
   833 
   825             p = subprocess.Popen(cmd, **args)
   834             p = subprocess.Popen(pycompat.rapply(procutil.tonativestr, cmd),
       
   835                                  **args)
   826 
   836 
   827         except OSError as e:
   837         except OSError as e:
   828             raise WatchmanError('"watchman" executable not in PATH (%s)' % e)
   838             raise WatchmanError('"watchman" executable not in PATH (%s)' % e)
   829 
   839 
   830         stdout, stderr = p.communicate()
   840         stdout, stderr = p.communicate()