• Home
  • Raw
  • Download

Lines Matching full:commit

61   def commit_exists(self, commit):  argument
62 """Checks to see if a commit exists in the project repo.
65 commit: The commit SHA you are checking.
68 True if the commit exits in the project.
70 if not commit.rstrip():
73 _, _, err_code = self.git(['cat-file', '-e', commit])
76 def commit_date(self, commit): argument
77 """Get the date of a commit.
80 commit: The commit hash.
83 A datetime representing the date of the commit.
85 out, _, _ = self.git(['show', '-s', '--format=%ct', commit],
108 """Gets the current commit SHA of the repo.
111 The current active commit SHA.
116 def get_parent(self, commit, count): argument
117 """Gets the count'th parent of the given commit.
120 The parent commit SHA.
123 out, _, err_code = self.git(['rev-parse', commit + '~' + str(count)],
142 newest_commit: The newest commit to be in the list.
143 oldest_commit: The (optional) oldest commit to be in the list.
146 The list of commit SHAs from newest to oldest.
149 ValueError: When either the oldest or newest commit does not exist.
150 RuntimeError: When there is an error getting the commit list.
154 raise ValueError('The oldest commit %s does not exist' % oldest_commit)
156 raise ValueError('The newest commit %s does not exist' % newest_commit)
171 commits = [commit for commit in commits if commit]
173 raise RuntimeError('Error getting commit list between %s and %s ' %
204 def checkout_commit(self, commit, clean=True): argument
205 """Checks out a specific commit from the repo.
208 commit: The commit SHA to be checked out.
212 ValueError: when commit does not exist.
215 if not self.commit_exists(commit):
216 raise ValueError('Commit %s does not exist in current branch' % commit)
217 self.git(['checkout', '-f', commit], check_result=True)
220 if self.get_current_commit() != commit:
221 raise RuntimeError('Error checking out commit %s' % commit)