mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
2f68d4b0d2
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
42 lines
1.1 KiB
Python
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))
|