view hgsubversion/layouts/base.py @ 1013:d507c1a12dcb

layouts: refactor mercurial branch to svn path mapping out of svnmeta This leaves the existing svnmeta.remotename as a proxy to the new layout objects rather than updating any of the callsites.
author David Schleimer <dschleimer@fb.com>
date Wed, 24 Apr 2013 15:23:33 -0700
parents e8cd211684c4
children 0ed7cf23e801
line wrap: on
line source

"""Module to hold the base API for layout classes.

This module should not contain any implementation, just a definition
of the API concrete layouts are expected to implement.

"""

from mercurial import util as hgutil

class BaseLayout(object):

    def __unimplemented(self, method_name):
        raise NotImplementedError(
            "Incomplete layout implementation: %s.%s doesn't implement %s" %
            (self.__module__, self.__name__, method_name))

    def localname(self, path):
        """Compute the local name for a branch located at path.
        """
        self.__unimplemented('localname')

    def remotename(self, branch):
        """Compute a subversion path for a mercurial branch name"""
        self.__unimplemented('remotename')