'This sets the doctree versioning method for this environment.
Versioning methods are a builder property; only builders with the same
versioning method can share the same doctree directory.  Therefore, we
raise an exception if the user tries to use an environment with an
incompatible versioning method.'

def set_versioning_method(self, method, compare):

    if (method not in versioning_conditions):
        raise ValueError(('invalid    versioning    method:    %r' % method))
    condition = versioning_conditions[method]
    if (self.versioning_condition not in (None, condition)):
        raise SphinxError('This    environment    is    incompatible    with    the    selected    builder,    please    choose    another    doctree    directory.')
    self.versioning_condition = condition
    self.versioning_compare = compare
