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

Add DiskObjectStore.init.

Changeset 230323f5d441

Parent 51cfd5f071d7

by Jelmer Vernooij

Changes to 3 files · Browse files at 230323f5d441 Showing diff from parent 51cfd5f071d7 Diff from another changeset...

 
477
478
479
 
 
 
 
 
 
 
 
 
 
 
480
481
482
 
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
@@ -477,6 +477,17 @@
  finally:   f.close()   + @classmethod + def init(cls, path): + try: + os.mkdir(path) + except OSError, e: + if e.errno != errno.EEXIST: + raise + os.mkdir(os.path.join(path, "info")) + os.mkdir(os.path.join(path, PACKDIR)) + return cls(path) +    class MemoryObjectStore(BaseObjectStore):   """Object store that keeps all objects in memory."""
Change 1 of 2 Show Entire File dulwich/​repo.py Stacked
 
62
63
64
65
66
67
68
69
70
 
1016
1017
1018
 
1019
1020
1021
 
62
63
64
 
 
 
65
66
67
 
1013
1014
1015
1016
1017
1018
1019
@@ -62,9 +62,6 @@
 INDEX_FILENAME = "index"    BASE_DIRECTORIES = [ - [OBJECTDIR], - [OBJECTDIR, "info"], - [OBJECTDIR, "pack"],   ["branches"],   [REFSDIR],   [REFSDIR, REFSDIR_TAGS], @@ -1016,6 +1013,7 @@
  def init_bare(cls, path, mkdir=True):   for d in BASE_DIRECTORIES:   os.mkdir(os.path.join(path, *d)) + DiskObjectStore.init(os.path.join(path, OBJECTDIR))   ret = cls(path)   ret.refs.set_symbolic_ref("HEAD", "refs/heads/master")   ret._put_named_file('description', "Unnamed repository")
 
103
104
105
106
 
107
108
109
 
103
104
105
 
106
107
108
109
@@ -103,7 +103,7 @@
  def setUp(self):   TestCase.setUp(self)   self.store_dir = tempfile.mkdtemp() - self.store = DiskObjectStore(self.store_dir) + self.store = DiskObjectStore.init(self.store_dir)     def tearDown(self):   TestCase.tearDown(self)