def get_commit(self, rev): if rev in self.commits: return self.commits[rev] self.commits[rev] = GitUtils.ref_commit(self.repo, rev) return self.commits[rev]
def cherry_pick(self, sha): GitExplodeUtils.git('cherry-pick', sha) self.update_current_topic(sha) head = GitExplodeUtils.get_head_sha1() self.exploded[sha] = head commit = GitUtils.ref_commit(self.repo, sha) self.logger.debug( "- cherry-picked %s as %s (%s)" % (sha[:8], self.exploded[sha][:8], GitUtils.oneline(commit)))
def __init__(self, repo, base, head, debug, context_lines): self.logger = standard_logger('git-explode', debug) self.debug = debug self.repo = repo self.base = base self.base_commit = GitUtils.ref_commit(repo, base) self.logger.debug("base commit %s is %s" % (base, GitUtils.commit_summary(self.base_commit))) self.head = head self.context_lines = context_lines self.topic_mgr = TopicManager('topic%d', self.logger) # Map commits to their exploded version self.exploded = {}