def test_empty_diff(self): branch = GitBranch(self.repo.path, "master") revid = self.repo.do_commit("message", committer="Jelmer Vernooij") entry, diff = list(branch.diff(revid)) self.assertEquals("message", entry.message) self.assertEquals("", diff)
def test_log_empty(self): branch = GitBranch(self.repo.path, "master") self.assertEquals([], list(branch.log()))
def test_log_commits(self): branch = GitBranch(self.repo.path, "master") self.repo.do_commit("message", committer="Jelmer Vernooij") log = list(branch.log()) self.assertEquals(1, len(log)) self.assertEquals("message", log[0].message)
def get_branch(self): if self.scm == "git": return GitBranch(os.path.join(GIT_ROOT, self.repo), self.branch) else: raise NotImplementedError(self.scm)