: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
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.
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: