def construct_historage(self): logger.info('convert a git repository to a historage...') historage_repo = self.prepare_historage_repo() committer = SyntaxTreesCommitter(Repo(self.org_repo.git_dir), historage_repo, self.syntax_trees_dir) num_commits = self.num_commits if self.num_commits != 0 else '???' for num, commit in izip(count(), get_reversed_topological_ordered_commits(self.org_repo, self.org_repo.refs)): logger.info('[%d/%s] convert %s to: %s' % (num, num_commits, commit.hexsha, historage_repo.git_dir)) committer.apply_change(commit) committer.create_heads() committer.create_tags() if not self.is_bare_repo: historage_repo.head.reset(working_tree=True) logger.info('completed!')
def construct_historage(self): print 'create historage...' base_repo = self.prepare_base_repo() committer = SyntaxTreesCommitter(Repo(self.org_repo.git_dir), base_repo, self.syntax_trees_dir) num_commits = self.num_commits if self.num_commits != 0 else '???' for num, commit in izip(count(), get_reversed_topological_ordered_commits(self.org_repo, self.org_repo.refs)): commit = self.org_repo.commit(commit) print '[%d/%s] convert %s to: %s' % (num, num_commits, commit.hexsha, base_repo.git_dir) committer.apply_change(commit) committer.create_heads() committer.create_tags() if not self.is_bare_repo: base_repo.head.reset(working_tree=True)
def construct_historage(self): logger.info('convert a git repository to a historage...') historage_repo = self.prepare_historage_repo() committer = SyntaxTreesCommitter(Repo(self.org_repo.git_dir), historage_repo, self.syntax_trees_dir) num_commits = self.num_commits if self.num_commits != 0 else '???' for num, commit in zip( count(), get_reversed_topological_ordered_commits( self.org_repo, self.org_repo.refs)): logger.info( '[%d/%s] convert %s to: %s' % (num, num_commits, commit.hexsha, historage_repo.git_dir)) committer.apply_change(commit) committer.create_heads() committer.create_tags() if not self.is_bare_repo: historage_repo.head.reset(working_tree=True) logger.info('completed!')