def _branch_name(cls, version):
    """Defines a mapping between versions and branches.

    In particular, `-dev` suffixed releases always live on master. Any other (modern) release
    lives in a branch.
    """
    suffix = version.public[len(version.base_version):]
    components = version.base_version.split('.') + [suffix]
    if suffix == '' or suffix.startswith('rc'):
      # An un-suffixed, or suffixed-with-rc version is a release from a stable branch.
      return '{}.{}.x'.format(*components[:2])
    elif suffix.startswith('.dev'):
      # Suffixed `dev` release version in master.
      return 'master'
    else:
      raise ValueError('Unparseable pants version number: {}'.format(version))
Defines a mapping between versions and branches.

    In particular, `-dev` suffixed releases always live on master. Any other (modern) release
    lives in a branch.