def _get_commit_item(self, commit_pt): for commit in self._csheet.commit_history: if commit.is_at(commit_pt): prev_commit = \ self._csheet.commit_history.get_prev_commit(commit) next_commit = \ self._csheet.commit_history.get_next_commit(commit) return CommitItem(commit, hasbefore=prev_commit is not None, hasafter=next_commit is not None) return CommitItem(Commit.from_point(commit_pt))
def get_commit_at_point(self, commit_point): commit = self.commit_history.get_commit_at(commit_point) return commit or Commit.from_point(commit_point)