mercurial/util.py
changeset 2788 1e8b8107a2c9
parent 2786 f4d916351366
child 2858 345bac2bc4ec
child 2859 b3d1145ed06c
equal deleted inserted replaced
2787:8ec1b1f0a5f7 2788:1e8b8107a2c9
    97     """apply the patch <patchname> to the working directory.
    97     """apply the patch <patchname> to the working directory.
    98     a list of patched files is returned"""
    98     a list of patched files is returned"""
    99     patcher = find_in_path('gpatch', os.environ.get('PATH', ''), 'patch')
    99     patcher = find_in_path('gpatch', os.environ.get('PATH', ''), 'patch')
   100     args = []
   100     args = []
   101     if cwd:
   101     if cwd:
   102         args.append('-d "%s"' % cwd)
   102         args.append('-d %s' % shellquote(cwd))
   103     fp = os.popen('%s %s -p%d < "%s"' % (patcher, ' '.join(args), strip,
   103     fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip,
   104                                          patchname))
   104                                        shellquote(patchname)))
   105     files = {}
   105     files = {}
   106     for line in fp:
   106     for line in fp:
   107         line = line.rstrip()
   107         line = line.rstrip()
   108         ui.status("%s\n" % line)
   108         ui.status("%s\n" % line)
   109         if line.startswith('patching file '):
   109         if line.startswith('patching file '):