本文整理汇总了Python中commit.Commit.find_all方法的典型用法代码示例。如果您正苦于以下问题:Python Commit.find_all方法的具体用法?Python Commit.find_all怎么用?Python Commit.find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commit.Commit
的用法示例。
在下文中一共展示了Commit.find_all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: commits
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commits(self, start='master', path='', max_count=10, skip=0):
"""
A list of Commit objects representing the history of a given ref/commit
``start``
is the branch/commit name (default 'master')
``path``
is an optional path to limit the returned commits to
Commits that do not contain that path will not be returned.
``max_count``
is the maximum number of commits to return (default 10)
``skip``
is the number of commits to skip (default 0) which will effectively
move your commit-window by the given number.
Returns
``git.Commit[]``
"""
options = {'max_count': max_count,
'skip': skip}
return Commit.find_all(self, start, path, **options)
示例2: commit_deltas_from
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commit_deltas_from(self, other_repo, ref='master', other_ref='master'):
"""
Returns a list of commits that is in ``other_repo`` but not in self
Returns
git.Commit[]
"""
repo_refs = self.git.rev_list(ref, '--').strip().splitlines()
other_repo_refs = other_repo.git.rev_list(other_ref, '--').strip().splitlines()
diff_refs = list(set(other_repo_refs) - set(repo_refs))
return map(lambda ref: Commit.find_all(other_repo, ref, max_count=1)[0], diff_refs)
示例3: commits_between
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commits_between(self, frm, to):
"""
The Commits objects that are reachable via ``to`` but not via ``frm``
Commits are returned in chronological order.
``from``
is the branch/commit name of the younger item
``to``
is the branch/commit name of the older item
Returns
``git.Commit[]``
"""
return reversed(Commit.find_all(self, "%s..%s" % (frm, to)))
示例4: commit
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commit(self, id):
"""
The Commit object for the specified id
``id``
is the SHA1 identifier of the commit
Returns
git.Commit
"""
options = {'max_count': 1}
commits = Commit.find_all(self, id, **options)
if not commits:
raise ValueError, 'Invalid identifier %s' % id
return commits[0]
示例5: commits_since
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commits_since(self, start = 'master', since = '1970-01-01'):
"""
The Commits objects that are newer than the specified date.
Commits are returned in chronological order.
``start``
is the branch/commit name (default 'master')
``since``
is a string represeting a date/time
Returns
``git.Commit[]``
"""
options = {'since': since}
return Commit.find_all(self, start, **options)
示例6: commit
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commit(self, id, path = ''):
"""
The Commit object for the specified id
``id``
is the SHA1 identifier of the commit
``path``
is an optional path, if set the returned commit must contain the path.
Returns
``git.Commit``
"""
options = {'max_count': 1}
commits = Commit.find_all(self, id, path, **options)
if not commits:
raise ValueError, "Invalid identifier %s, or given path '%s' too restrictive" % ( id, path )
return commits[0]
示例7: commits
# 需要导入模块: from commit import Commit [as 别名]
# 或者: from commit.Commit import find_all [as 别名]
def commits(self, start = 'master', max_count = 10, skip = 0):
"""
A list of Commit objects representing the history of a given ref/commit
``start``
is the branch/commit name (default 'master')
``max_count``
is the maximum number of commits to return (default 10)
``skip``
is the number of commits to skip (default 0)
Returns
``git.Commit[]``
"""
options = {'max_count': max_count,
'skip': skip}
return Commit.find_all(self, start, **options)