Mercurial > hg
comparison mercurial/util.py @ 1521:11a58d2cdffb
copy the mode of the file when breaking hardlinks
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 09 Nov 2005 13:38:46 -0800 |
parents | 4d38b85e60aa |
children | c9f33196805b |
comparison
equal
deleted
inserted
replaced
1519:5b19dea9d4fd | 1521:11a58d2cdffb |
---|---|
385 except: | 385 except: |
386 try: os.unlink(temp) | 386 try: os.unlink(temp) |
387 except: pass | 387 except: pass |
388 raise | 388 raise |
389 fp.close() | 389 fp.close() |
390 st = os.lstat(f) | |
391 os.chmod(temp, st.st_mode) | |
390 rename(temp, f) | 392 rename(temp, f) |
391 | 393 |
392 return file(f, mode) | 394 return file(f, mode) |
393 | 395 |
394 return o | 396 return o |