def vcsPrivateDirectory(repo):
  """Get |VCS| private directory of a repository.

  :param repo:
    Repository instance.
  :type repo:
    :class:`git.Repo <git:git.repo.base.Repo>` or
    :class:`.Subversion.Repository`.

  :return: Absolute path to the |VCS| private directory.
  :rtype: :class:`basestring`

  :raises:
    :exc:`~exceptions.Exception` if the private directory cannot be determined.

  This returns the |VCS| private directory for a repository, e.g. the ``.git``
  or ``.svn`` directory.
  """

  if hasattr(repo, "git_dir"):
    return repo.git_dir

  if hasattr(repo, "svn_dir"):
    return repo.svn_dir

  raise Exception("unable to determine repository local private directory")