Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

object_store.DiskObjectStore.move_in_thin_pack: close temp pack
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Changeset e0361ef93b60

Parent dc9ff93f6a72

committed by Jelmer Vernooij

authored by Tay Ray Chuan

Changes to one file · Browse files at e0361ef93b60 Showing diff from parent dc9ff93f6a72 Diff from another changeset...

 
402
403
404
405
406
407
408
 
 
 
 
 
 
 
 
409
410
411
 
402
403
404
 
 
 
 
405
406
407
408
409
410
411
412
413
414
415
@@ -402,10 +402,14 @@
  data.create_index_v2(temppath)   p = Pack.from_objects(data, load_pack_index(temppath))   - # Write a full pack version - temppath = os.path.join(self.pack_dir, - sha_to_hex(urllib2.randombytes(20))+".temppack") - write_pack(temppath, ((o, None) for o in p.iterobjects()), len(p)) + try: + # Write a full pack version + temppath = os.path.join(self.pack_dir, + sha_to_hex(urllib2.randombytes(20))+".temppack") + write_pack(temppath, ((o, None) for o in p.iterobjects()), len(p)) + finally: + p.close() +   pack_sha = load_pack_index(temppath+".idx").objects_sha1()   newbasename = os.path.join(self.pack_dir, "pack-%s" % pack_sha)   os.rename(temppath+".pack", newbasename+".pack")