def _mksubs(self): self._subs = {} tags = git.list_refs(repo_dir=self._repo_dir, limit_to_tags=True) tags, tags_dup = tee(tags) tags_info = git.object_info((x[1].encode('hex') for x in tags_dup), repo_dir=self._repo_dir) for (name, sha), info in izip(tags, tags_info): assert(name.startswith('refs/tags/')) name = name[10:] commithex = sha.encode('hex') type = info[1] if type == 'commit': # FIXME: handle this in bulk. date = git.get_commit_dates([sha.encode('hex')], repo_dir=self._repo_dir)[0] target = '../.commit/%s/%s' % (commithex[:2], commithex[2:]) tag1 = CommitLink(self, name, target, repo_dir=self._repo_dir) tag1.ctime = tag1.mtime = date elif type == 'tree': tag1 = Dir(self, name, GIT_MODE_TREE, sha, repo_dir=self._repo_dir) elif type == 'blob': tag1 = File(self, name, GIT_MODE_FILE, sha, git.BUP_NORMAL, repo_dir=self._repo_dir) else: assert(False) self._subs[name] = tag1
def _mksubs(self): self._subs = {} for (name, sha) in git.list_refs(): if name.startswith('refs/tags/'): name = name[10:] date = git.get_commit_dates([sha.encode('hex')])[0] commithex = sha.encode('hex') target = '../.commit/%s/%s' % (commithex[:2], commithex[2:]) tag1 = FakeSymlink(self, name, target) tag1.ctime = tag1.mtime = date self._subs[name] = tag1
def _mksubs(self): self._subs = {} for (name, sha) in git.list_refs(repo_dir=self._repo_dir): if name.startswith("refs/tags/"): name = name[10:] date = git.get_commit_dates([sha.encode("hex")], repo_dir=self._repo_dir)[0] commithex = sha.encode("hex") target = "../.commit/%s/%s" % (commithex[:2], commithex[2:]) tag1 = FakeSymlink(self, name, target, repo_dir, self._repo_dir) tag1.ctime = tag1.mtime = date self._subs[name] = tag1
def _mksubs(self): self._subs = {} commit_dir = CommitDir(self, ".commit", self._repo_dir) self._subs[".commit"] = commit_dir tag_dir = TagDir(self, ".tag", self._repo_dir) self._subs[".tag"] = tag_dir refs_info = [ (name[11:], sha) for (name, sha) in git.list_refs(repo_dir=self._repo_dir) if name.startswith("refs/heads/") ] dates = git.get_commit_dates([sha.encode("hex") for (name, sha) in refs_info], repo_dir=self._repo_dir) for (name, sha), date in zip(refs_info, dates): n1 = BranchList(self, name, sha, self._repo_dir) n1.ctime = n1.mtime = date self._subs[name] = n1
def _mksubs(self): self._subs = {} commit_dir = CommitDir(self, '.commit', self._repo_dir) self._subs['.commit'] = commit_dir tag_dir = TagDir(self, '.tag', self._repo_dir) self._subs['.tag'] = tag_dir refs_info = [(name[11:], sha) for (name, sha) in git.list_refs(repo_dir=self._repo_dir) if name.startswith('refs/heads/')] dates = git.get_commit_dates( [sha.encode('hex') for (name, sha) in refs_info], repo_dir=self._repo_dir) for (name, sha), date in zip(refs_info, dates): n1 = BranchList(self, name, sha, self._repo_dir) n1.ctime = n1.mtime = date self._subs[name] = n1
def _mksubs(self): self._subs = {} commit_dir = CommitDir(self, '.commit') self._subs['.commit'] = commit_dir tag_dir = TagDir(self, '.tag') self._subs['.tag'] = tag_dir refs_info = [(name[11:], sha) for (name,sha) in git.list_refs() \ if name.startswith('refs/heads/')] dates = git.get_commit_dates([sha.encode('hex') for (name, sha) in refs_info]) for (name, sha), date in zip(refs_info, dates): n1 = BranchList(self, name, sha) n1.ctime = n1.mtime = date self._subs[name] = n1