contrib/shrink-revlog.py
changeset 14235 b9e1b041744f
parent 14034 1f667030b139
child 15355 dbdb777502dc
equal deleted inserted replaced
14234:600e64004eb5 14235:b9e1b041744f
   249                 ignoremissing(os.unlink)(fn)
   249                 ignoremissing(os.unlink)(fn)
   250             raise
   250             raise
   251         if not opts.get('dry_run'):
   251         if not opts.get('dry_run'):
   252             # racy, both files cannot be renamed atomically
   252             # racy, both files cannot be renamed atomically
   253             # copy files
   253             # copy files
   254             util.os_link(indexfn, oldindexfn)
   254             util.oslink(indexfn, oldindexfn)
   255             ignoremissing(util.os_link)(datafn, olddatafn)
   255             ignoremissing(util.oslink)(datafn, olddatafn)
   256 
   256 
   257             # rename
   257             # rename
   258             util.rename(tmpindexfn, indexfn)
   258             util.rename(tmpindexfn, indexfn)
   259             try:
   259             try:
   260                 os.chmod(tmpdatafn, os.stat(datafn).st_mode)
   260                 os.chmod(tmpdatafn, os.stat(datafn).st_mode)