code: def _realpath(self, relpath):
      
      obj, path_so_far = self._read_object(relpath, MAX_SYMLINKS_IN_REALPATH)
      if isinstance(obj, self.Symlink):
        raise self.SymlinkLoopException(self.rev, relpath)
      return path_so_far
docs: Follow symlinks to find the real path to a file or directory in the repo.
  
      :returns: if the expanded path points to a file, the relative path
                to that file; if a directory, the relative path + '/'; if
                a symlink outside the repo, a path starting with / or ../.