~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Patch Queue Manager
  • Date: 2014-10-06 16:32:42 UTC
  • mfrom: (6597.2.4 split-diff-tests)
  • Revision ID: pqm@pqm.ubuntu.com-20141006163242-c2cll01cwc24grkk
(vila) Split some tests to be able to get finer grained failures (Vincent
 Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
    finally:
287
287
        oldtmpf.close()                 # and delete
288
288
        newtmpf.close()
289
 
        # Clean up. Warn in case the files couldn't be deleted
290
 
        # (in case windows still holds the file open, but not
291
 
        # if the files have already been deleted)
292
 
        try:
293
 
            os.remove(old_abspath)
294
 
        except OSError, e:
295
 
            if e.errno not in (errno.ENOENT,):
296
 
                warning('Failed to delete temporary file: %s %s',
297
 
                        old_abspath, e)
298
 
        try:
299
 
            os.remove(new_abspath)
300
 
        except OSError, e:
301
 
            if e.errno not in (errno.ENOENT,):
302
 
                warning('Failed to delete temporary file: %s %s',
303
 
                        new_abspath, e)
 
289
 
 
290
        def cleanup(path):
 
291
            # Warn in case the file couldn't be deleted (in case windows still
 
292
            # holds the file open, but not if the files have already been
 
293
            # deleted)
 
294
            try:
 
295
                os.remove(path)
 
296
            except OSError, e:
 
297
                if e.errno not in (errno.ENOENT,):
 
298
                    warning('Failed to delete temporary file: %s %s', path, e)
 
299
 
 
300
        cleanup(old_abspath)
 
301
        cleanup(new_abspath)
304
302
 
305
303
 
306
304
def get_trees_and_branches_to_diff_locked(