X-Git-Url: http://git.samba.org/samba.git/?p=jelmer%2Fdulwich-libgit2.git;a=blobdiff_plain;f=dulwich%2Fobject_store.py;h=461fc17e41456ee77c26e5c867dc3c64abe337d2;hp=ca26348ef495ac1b79f296fefdf55615ce5a1dc8;hb=31a832600d8f873640dfc9a8afd4b2c59512abd9;hpb=2ae0459169dc045d0181bd047cdcb93afe906a9e diff --git a/dulwich/object_store.py b/dulwich/object_store.py index ca26348..461fc17 100644 --- a/dulwich/object_store.py +++ b/dulwich/object_store.py @@ -470,8 +470,11 @@ class DiskObjectStore(PackBasedObjectStore): :param obj: Object to add """ dir = os.path.join(self.path, obj.id[:2]) - if not os.path.isdir(dir): + try: os.mkdir(dir) + except OSError, e: + if e.errno != errno.EEXIST: + raise path = os.path.join(dir, obj.id[2:]) if os.path.exists(path): return # Already there, no need to write again @@ -691,7 +694,12 @@ class MissingObjectFinder(object): class ObjectStoreGraphWalker(object): - """Graph walker that finds out what commits are missing from an object store.""" + """Graph walker that finds out what commits are missing from an object + store. + + :ivar heads: Revisions without descendants in the local repo + :ivar get_parents: Function to retrieve parents in the local repo + """ def __init__(self, local_heads, get_parents): """Create a new instance. @@ -704,7 +712,7 @@ class ObjectStoreGraphWalker(object): self.parents = {} def ack(self, sha): - """Ack that a particular revision and its ancestors are present in the source.""" + """Ack that a revision and its ancestors are present in the source.""" if sha in self.heads: self.heads.remove(sha) if sha in self.parents: