##// END OF EJS Templates
bundlerepo: avoid exception in __del__ when the bundle doesn't exist...
Alexis S. L. Carvalho -
r3429:b19360aa default
parent child Browse files
Show More
@@ -233,10 +233,12 b' class bundlerepository(localrepo.localre'
233 self.bundlefile.close()
233 self.bundlefile.close()
234
234
235 def __del__(self):
235 def __del__(self):
236 if not self.bundlefile.closed:
236 bundlefile = getattr(self, 'bundlefile', None)
237 self.bundlefile.close()
237 if bundlefile and not bundlefile.closed:
238 if self.tempfile is not None:
238 bundlefile.close()
239 os.unlink(self.tempfile)
239 tempfile = getattr(self, 'tempfile', None)
240 if tempfile is not None:
241 os.unlink(tempfile)
240
242
241 def instance(ui, path, create):
243 def instance(ui, path, create):
242 if create:
244 if create:
@@ -57,4 +57,5 b' cd partial'
57 hg -R bundle://../full.hg log
57 hg -R bundle://../full.hg log
58 hg incoming bundle://../full.hg
58 hg incoming bundle://../full.hg
59 hg -R bundle://../full.hg outgoing ../partial2
59 hg -R bundle://../full.hg outgoing ../partial2
60 hg -R bundle://../does-not-exist.hg outgoing ../partial2
60 cd ..
61 cd ..
@@ -208,3 +208,4 b' user: test'
208 date: Mon Jan 12 13:46:40 1970 +0000
208 date: Mon Jan 12 13:46:40 1970 +0000
209 summary: 0.3m
209 summary: 0.3m
210
210
211 abort: No such file or directory: ../does-not-exist.hg
General Comments 0
You need to be logged in to leave comments. Login now