def check_baseline(self, exp_rev):
    baseline_sha = self.repo.scm.get_rev()
    if (exp_rev == baseline_sha):
        return exp_rev
    exp_baseline = self._get_baseline(exp_rev)
    if (exp_baseline is None):
        exp_commit = self.scm.resolve_commit(exp_rev)
        if exp_commit:
            exp_baseline = first(exp_commit.parents).hexsha
    if (exp_baseline == baseline_sha):
        return exp_baseline
    raise BaselineMismatchError(exp_baseline, baseline_sha)
def check_baseline(self, exp_rev):
    baseline_sha = self.repo.scm.get_rev()
    if (exp_rev == baseline_sha):
        return exp_rev
    exp_baseline = self._get_baseline(exp_rev)
    if (exp_baseline is None):
        exp_commit = self.scm.resolve_commit(exp_rev)
        if exp_commit:
            exp_baseline = first(exp_commit.parents).hexsha
    if (exp_baseline == baseline_sha):
        return exp_baseline
    raise BaselineMismatchError(exp_baseline, baseline_sha)