本文整理匯總了Python中repository.Repository.get_commit方法的典型用法代碼示例。如果您正苦於以下問題:Python Repository.get_commit方法的具體用法?Python Repository.get_commit怎麽用?Python Repository.get_commit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類repository.Repository
的用法示例。
在下文中一共展示了Repository.get_commit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: BaseHaskiAction
# 需要導入模塊: from repository import Repository [as 別名]
# 或者: from repository.Repository import get_commit [as 別名]
class BaseHaskiAction(object):
"""This class is the abstract base class for Haski tasks.
"""
__metaclass__ = ABCMeta
def __init__(self):
self._repository = Repository()
@abstractmethod
def __call__(self, namespace):
"""This method is invoked by argparse and should do the actuall work.
By default, it is abstract and does nothing, so it forces you to
implement it.
"""
pass
def get_commit(self, namespace):
"""This function gets the commit wanted commit on which an action is to
be performed.
"""
commit = self._repository.get_commit(namespace.revision)
return commit
def get_repository_location(self):
"""Returns the directory where this repository is located.
"""
return self._repository.get_path()