##// END OF EJS Templates
largefiles: simplify lfutil.writehash...
Martin Geisler -
r15574:c9328c82 default
parent child Browse files
Show More
@@ -393,17 +393,8 b' def readhash(filename):'
393
393
394 def writehash(hash, filename, executable):
394 def writehash(hash, filename, executable):
395 util.makedirs(os.path.dirname(filename))
395 util.makedirs(os.path.dirname(filename))
396 if os.path.exists(filename):
396 util.writefile(filename, hash + '\n')
397 os.unlink(filename)
397 os.chmod(filename, getmode(executable))
398 wfile = open(filename, 'wb')
399
400 try:
401 wfile.write(hash)
402 wfile.write('\n')
403 finally:
404 wfile.close()
405 if os.path.exists(filename):
406 os.chmod(filename, getmode(executable))
407
398
408 def getexecutable(filename):
399 def getexecutable(filename):
409 mode = os.stat(filename).st_mode
400 mode = os.stat(filename).st_mode
General Comments 0
You need to be logged in to leave comments. Login now