Source code for tool_shed.repository_types.metadata

import logging

from tool_shed.util import hg_util

log = logging.getLogger(__name__)


[docs]class Metadata(object):
[docs] def __init__(self): self.type = None
[docs] def get_changesets_for_setting_metadata(self, app, repository): repo = hg_util.get_repo_for_repository(app, repository=repository) return repo.changelog
[docs] def is_valid_for_type(self, app, repository, revisions_to_check=None): raise Exception("Unimplemented Method")
[docs]class TipOnly(Metadata):
[docs] def __init__(self): self.type = None
[docs] def get_changesets_for_setting_metadata(self, app, repository): repo = hg_util.get_repo_for_repository(app, repository=repository) return [repo.changelog.tip()]