sapling/eden/scm/edenscm/mercurial/__init__.py
Mateusz Kwapich 2f68d4b0d2 remove py3 code transform
Summary:
We won't need it as we're going straight to dual-compatible code instead of
transforming it.

Reviewed By: quark-zju

Differential Revision: D19588132

fbshipit-source-id: 100f19b3e29874de9e8d48692c42cb2d5856bf5a
2020-01-27 19:00:14 -08:00

42 lines
1.1 KiB
Python

# Portions Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# __init__.py - Startup and module loading logic for Mercurial.
#
# Copyright 2015 Gregory Szorc <gregory.szorc@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import os
import sys
# Allow 'from mercurial import demandimport' to keep working.
from edenscm import hgdemandimport
demandimport = hgdemandimport
__all__ = []
if getattr(sys, "platform") == "win32":
configdir = os.path.join(
getattr(os, "environ").get("PROGRAMDATA") or "\ProgramData",
"Facebook",
"Mercurial",
)
else:
configdir = "/etc/mercurial"
def shoulduselegacy(name):
legacy = getattr(os, "environ").get("HGLEGACY")
if legacy is not None:
return name in legacy.split()
else:
return os.path.lexists(os.path.join(configdir, "legacy.%s" % name))