Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 9548:7732606b0767
util: state docstring of rename more precisely
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Wed, 07 Oct 2009 20:16:43 +0200 |
parents | b6b0c42739e9 |
children | 8b8920209317 |
comparison
equal
deleted
inserted
replaced
9547:f57640bf10d4 | 9548:7732606b0767 |
---|---|
398 except: | 398 except: |
399 return False | 399 return False |
400 return True | 400 return True |
401 | 401 |
402 def rename(src, dst): | 402 def rename(src, dst): |
403 """forcibly rename a file""" | 403 '''atomically rename file src to dst, replacing dst if it exists''' |
404 try: | 404 try: |
405 os.rename(src, dst) | 405 os.rename(src, dst) |
406 except OSError, err: # FIXME: check err (EEXIST ?) | 406 except OSError, err: # FIXME: check err (EEXIST ?) |
407 | 407 |
408 # On windows, rename to existing file is not allowed, so we | 408 # On windows, rename to existing file is not allowed, so we |