Show More
@@ -296,6 +296,9 b' def patch(patchname, ui, strip=1, cwd=No' | |||||
296 | patcher = util.find_in_path('gpatch', os.environ.get('PATH', ''), |
|
296 | patcher = util.find_in_path('gpatch', os.environ.get('PATH', ''), | |
297 | 'patch') |
|
297 | 'patch') | |
298 | args = [] |
|
298 | args = [] | |
|
299 | if util.needbinarypatch(): | |||
|
300 | args.append('--binary') | |||
|
301 | ||||
299 | if cwd: |
|
302 | if cwd: | |
300 | args.append('-d %s' % util.shellquote(cwd)) |
|
303 | args.append('-d %s' % util.shellquote(cwd)) | |
301 | fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
|
304 | fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
@@ -793,6 +793,10 b' def linkfunc(path, fallback):' | |||||
793 | _umask = os.umask(0) |
|
793 | _umask = os.umask(0) | |
794 | os.umask(_umask) |
|
794 | os.umask(_umask) | |
795 |
|
795 | |||
|
796 | def needbinarypatch(): | |||
|
797 | """return True if patches should be applied in binary mode by default.""" | |||
|
798 | return os.name == 'nt' | |||
|
799 | ||||
796 | # Platform specific variants |
|
800 | # Platform specific variants | |
797 | if os.name == 'nt': |
|
801 | if os.name == 'nt': | |
798 | import msvcrt |
|
802 | import msvcrt |
General Comments 0
You need to be logged in to leave comments.
Login now