Merge lp:~maxb/bzr-fastimport/trivial-duplicate-removal into lp:bzr-fastimport

Proposed by Max Bowsher
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 301
Proposed branch: lp:~maxb/bzr-fastimport/trivial-duplicate-removal
Merge into: lp:bzr-fastimport
Diff against target: 37 lines (+0/-27)
1 file modified
cache_manager.py (+0/-27)
To merge this branch: bzr merge lp:~maxb/bzr-fastimport/trivial-duplicate-removal
Reviewer Review Type Date Requested Status
Bazaar Developers Pending
Review via email: mp+44423@code.launchpad.net

Description of the change

A bad merge has introduced two copies of the definition of a class. Remove one of them.

To post a comment you must log in.
301. By Max Bowsher

[r=mbp] Remove duplicate definition of cache_manager._Cleanup.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cache_manager.py'
--- cache_manager.py 2010-11-06 16:06:21 +0000
+++ cache_manager.py 2010-12-22 03:40:46 +0000
@@ -61,33 +61,6 @@
61 shutil.rmtree(self.tempdir)61 shutil.rmtree(self.tempdir)
6262
6363
64class _Cleanup(object):
65 """This class makes sure we clean up when CacheManager goes away.
66
67 We use a helper class to ensure that we are never in a refcycle.
68 """
69
70 def __init__(self, disk_blobs):
71 self.disk_blobs = disk_blobs
72 self.tempdir = None
73 self.small_blobs = None
74
75 def __del__(self):
76 self.finalize()
77
78 def finalize(self):
79 if self.disk_blobs is not None:
80 for info in self.disk_blobs.itervalues():
81 if info[-1] is not None:
82 os.unlink(info[-1])
83 self.disk_blobs = None
84 if self.small_blobs is not None:
85 self.small_blobs.close()
86 self.small_blobs = None
87 if self.tempdir is not None:
88 shutil.rmtree(self.tempdir)
89
90
91class CacheManager(object):64class CacheManager(object):
9265
93 _small_blob_threshold = 25*102466 _small_blob_threshold = 25*1024

Subscribers

People subscribed via source and target branches