diff --git a/osctiny/extensions/packages.py b/osctiny/extensions/packages.py index 17a5827..11f98f0 100644 --- a/osctiny/extensions/packages.py +++ b/osctiny/extensions/packages.py @@ -346,21 +346,25 @@ def get_attribute(self, project, package, attribute=None): return self.osc.get_objectified_xml(response) - def get_history(self, project, package): + def get_history(self, project, package, limit = None): """ Get history of package :param project: name of project :param package: name of package + :param limit: Optional number of history entries to return. If + specified, only the last n entries are returned. :return: Objectified XML element :rtype: lxml.objectify.ObjectifiedElement """ + params = {"limit": limit} if limit else {} response = self.osc.request( url=urljoin( self.osc.url, "{}/{}/{}/_history".format(self.base_path, project, package) ), - method="GET" + method="GET", + params=params, ) return self.osc.get_objectified_xml(response)