~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

Merge the fix for the update_by_delta bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
    else:
225
225
        file_existed = True
226
226
 
227
 
    failure_exc = None
228
227
    success = False
229
228
    try:
230
229
        try:
236
235
            # source and target may be aliases of each other (e.g. on a
237
236
            # case-insensitive filesystem), so we may have accidentally renamed
238
237
            # source by when we tried to rename target
239
 
            failure_exc = sys.exc_info()
240
 
            if (file_existed and e.errno in (None, errno.ENOENT)
241
 
                and old.lower() == new.lower()):
242
 
                # source and target are the same file on a case-insensitive
243
 
                # filesystem, so we don't generate an exception
244
 
                failure_exc = None
 
238
            if not (file_existed and e.errno in (None, errno.ENOENT)):
 
239
                raise
245
240
    finally:
246
241
        if file_existed:
247
242
            # If the file used to exist, rename it back into place
250
245
                unlink_func(tmp_name)
251
246
            else:
252
247
                rename_func(tmp_name, new)
253
 
    if failure_exc is not None:
254
 
        raise failure_exc[0], failure_exc[1], failure_exc[2]
255
248
 
256
249
 
257
250
# In Python 2.4.2 and older, os.path.abspath and os.path.realpath