hgext3rd/topic/compat.py
author Sushil khanchi <sushilkhanchi97@gmail.com>
Sun, 13 Jan 2019 19:33:19 +0530
changeset 4382 e6ba7e324015
parent 3701 29c413a7dfb5
child 4743 92e3db149d7d
permissions -rw-r--r--
evolve: introduce function to create a obsmarker relation even for public cset To create obsmarkers we use obsolete.createmarkers() function, but because of security reasons this function refuses to create obsmarkers for public cset. And we need to create obsmarkers for a public cset while solving public content divergence. So introducing this function which create a obsmarker relation even for immutable cset. Currently this function create obsmarker for a single relation, in contrast of obsolete.createmarkers() which create markers for multiple relations. Upcoming pathces will be using this function.

# Copyright 2017 FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""
Compatibility module
"""
from __future__ import absolute_import

from mercurial import (
    obsolete,
)

getmarkers = None
successorssets = None
try:
    from mercurial import obsutil
    getmarkers = getattr(obsutil, 'getmarkers', None)
    successorssets = getattr(obsutil, 'successorssets', None)
except ImportError:
    pass

if getmarkers is None:
    getmarkers = obsolete.getmarkers
if successorssets is None:
    successorssets = obsolete.successorssets