comparison mercurial/util.py @ 1593:6bb3463b124b

if a filename contains spaces, patch adds quote around it
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Thu, 15 Dec 2005 17:50:10 +0100
parents d7c4b9bfcc94
children a329e0fda2ae
comparison
equal deleted inserted replaced
1588:a679a364436a 1593:6bb3463b124b
523 rcpath.append(os.path.expanduser('~/.hgrc')) 523 rcpath.append(os.path.expanduser('~/.hgrc'))
524 rcpath = [os.path.normpath(f) for f in rcpath] 524 rcpath = [os.path.normpath(f) for f in rcpath]
525 525
526 def parse_patch_output(output_line): 526 def parse_patch_output(output_line):
527 """parses the output produced by patch and returns the file name""" 527 """parses the output produced by patch and returns the file name"""
528 return output_line[14:] 528 pf = output_line[14:]
529 if pf.startswith("'") and pf.endswith("'") and pf.find(" ") >= 0:
530 pf = pf[1:-1] # Remove the quotes
531 return pf
529 532
530 def is_exec(f, last): 533 def is_exec(f, last):
531 """check whether a file is executable""" 534 """check whether a file is executable"""
532 return (os.stat(f).st_mode & 0100 != 0) 535 return (os.stat(f).st_mode & 0100 != 0)
533 536