comparison hgext/mq.py @ 2786:f4d916351366

Add portable shell-quoting function; teach mq to use it.
author Brendan Cully <brendan@kublai.com>
date Sat, 05 Aug 2006 15:23:26 -0700
parents ae726521717c
children 8ec1b1f0a5f7
comparison
equal deleted inserted replaced
2785:58a679745b38 2786:f4d916351366
270 def patch(self, repo, patchfile): 270 def patch(self, repo, patchfile):
271 '''Apply patchfile to the working directory. 271 '''Apply patchfile to the working directory.
272 patchfile: file name of patch''' 272 patchfile: file name of patch'''
273 try: 273 try:
274 pp = util.find_in_path('gpatch', os.environ.get('PATH', ''), 'patch') 274 pp = util.find_in_path('gpatch', os.environ.get('PATH', ''), 'patch')
275 f = os.popen("%s -d '%s' -p1 --no-backup-if-mismatch < '%s'" % 275 f = os.popen("%s -d %s -p1 --no-backup-if-mismatch < %s" %
276 (pp, repo.root, patchfile)) 276 (pp, util.shellquote(repo.root), util.shellquote(patchfile)))
277 except: 277 except:
278 self.ui.warn("patch failed, unable to continue (try -v)\n") 278 self.ui.warn("patch failed, unable to continue (try -v)\n")
279 return (None, [], False) 279 return (None, [], False)
280 files = [] 280 files = []
281 fuzz = False 281 fuzz = False