def __init__(self, root, conf): """Init a Git bare Repository on top of a Swift container. References are managed in info/refs objects by `SwiftInfoRefsContainer`. The root attribute is the Swift container that contain the Git bare repository. Args: root: The container which contains the bare repo conf: A ConfigParser object """ self.root = root.lstrip("/") self.conf = conf self.scon = SwiftConnector(self.root, self.conf) objects = self.scon.get_container_objects() if not objects: raise Exception("There is not any GIT repo here : %s" % self.root) objects = [o["name"].split("/")[0] for o in objects] if OBJECTDIR not in objects: raise Exception("This repository (%s) is not bare." % self.root) self.bare = True self._controldir = self.root object_store = SwiftObjectStore(self.scon) refs = SwiftInfoRefsContainer(self.scon, object_store) BaseRepo.__init__(self, object_store, refs)
def __init__(self, redis, prefix): BaseRepo.__init__(self, RedisObjectStore(redis, prefix), RedisDictRefsContainer(redis, prefix)) self._named_files = Dict(redis=redis, pickler=cPickle, key='{0:s}:named_files'.format('prefix')) self._config = ConfigFile() self.bare = True
def __init__(self, RepoName): repo = Repositories.get_by_key_name(RepoName) if repo: self.REPO_NAME = RepoName self.REPO = Repositories.get_by_key_name(self.REPO_NAME) self.Bare = True object_store = ObjectStore(self.REPO) refs_container = RefsContainer(self.REPO) BaseRepo.__init__(self, object_store, refs_container) else: raise NotGitRepository(RepoName)
def __init__(self, root, conf): """Init a Git bare Repository on top of a Swift container. References are managed in info/refs objects by `SwiftInfoRefsContainer`. The root attribute is the Swift container that contain the Git bare repository. :param root: The container which contains the bare repo :param conf: A ConfigParser object """ self.root = root.lstrip('/') self.conf = conf self.scon = SwiftConnector(self.root, self.conf) objects = self.scon.get_container_objects() if not objects: raise Exception('There is not any GIT repo here : %s' % self.root) objects = [o['name'].split('/')[0] for o in objects] if OBJECTDIR not in objects: raise Exception('This repository (%s) is not bare.' % self.root) self.bare = True self._controldir = self.root object_store = SwiftObjectStore(self.scon) refs = SwiftInfoRefsContainer(self.scon, object_store) BaseRepo.__init__(self, object_store, refs)
def __init__(self): BaseRepo.__init__(self, ObjectStore(), DictRefsContainer({})) self._named_files = {} self.bare = True
def __init__(self, name): self._name = name BaseRepo.__init__(self, MysqlObjectStore(name), MysqlRefsContainer(name)) self.bare = True