mirror of
https://github.com/frej/fast-export.git
synced 2025-11-03 09:45:48 +01:00
Make hg-fast-export work on Windows
* use sys.stdout.write instead of print to avoid end-of-line issues * use os.devnull instead of hard-coding /dev/null
This commit is contained in:
@@ -23,9 +23,9 @@ def gitmode(flags):
|
||||
return 'l' in flags and '120000' or 'x' in flags and '100755' or '100644'
|
||||
|
||||
def wr(msg=''):
|
||||
if msg == None:
|
||||
msg = ''
|
||||
print msg
|
||||
if msg:
|
||||
sys.stdout.write(msg)
|
||||
sys.stdout.write('\n')
|
||||
#map(lambda x: sys.stderr.write('\t[%s]\n' % x),msg.split('\n'))
|
||||
|
||||
def checkpoint(count):
|
||||
|
||||
@@ -102,7 +102,7 @@ def save_cache(filename,cache):
|
||||
def get_git_sha1(name,type='heads'):
|
||||
try:
|
||||
# use git-rev-parse to support packed refs
|
||||
cmd="GIT_DIR='%s' git rev-parse --verify refs/%s/%s 2>/dev/null" % (os.getenv('GIT_DIR','/dev/null'),type,name)
|
||||
cmd="git rev-parse --verify refs/%s/%s 2>%s" % (type,name,os.devnull)
|
||||
p=os.popen(cmd)
|
||||
l=p.readline()
|
||||
p.close()
|
||||
|
||||
Reference in New Issue
Block a user