Merge pull request #5 from living180/master

Make hg-fast-export work on Windows
This commit is contained in:
frej
2012-06-01 08:05:31 -07:00
2 changed files with 4 additions and 4 deletions

View File

@@ -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):

View File

@@ -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()