/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugin.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
plugins.
35
35
"""
36
36
 
37
 
from __future__ import absolute_import
38
 
 
39
37
import os
40
38
import re
41
39
import sys
63
61
 
64
62
_MODULE_PREFIX = "breezy.plugins."
65
63
 
66
 
if __debug__ or sys.version_info > (3,):
67
 
    COMPILED_EXT = ".pyc"
68
 
else:
69
 
    COMPILED_EXT = ".pyo"
 
64
COMPILED_EXT = ".pyc"
70
65
 
71
66
 
72
67
def disable_plugins(state=None):
81
76
    state.plugins = {}
82
77
 
83
78
 
84
 
def load_plugins(path=None, state=None):
 
79
def load_plugins(path=None, state=None, warn_load_problems=True):
85
80
    """Load breezy plugins.
86
81
 
87
82
    The environment variable BRZ_PLUGIN_PATH is considered a delimited
108
103
    if (None, 'entrypoints') in _env_plugin_path():
109
104
        _load_plugins_from_entrypoints(state)
110
105
    state.plugins = plugins()
 
106
    if warn_load_problems:
 
107
        for plugin, errors in state.plugin_warnings.items():
 
108
            for error in errors:
 
109
                trace.warning('%s', error)
111
110
 
112
111
 
113
112
def _load_plugins_from_entrypoints(state):
194
193
def _env_disable_plugins(key='BRZ_DISABLE_PLUGINS'):
195
194
    """Gives list of names for plugins to disable from environ key."""
196
195
    disabled_names = []
197
 
    env = osutils.path_from_environ(key)
 
196
    env = os.environ.get(key)
198
197
    if env:
199
198
        for name in env.split(os.pathsep):
200
199
            name = _expect_identifier(name, key, env)
206
205
def _env_plugins_at(key='BRZ_PLUGINS_AT'):
207
206
    """Gives list of names and paths of specific plugins from environ key."""
208
207
    plugin_details = []
209
 
    env = osutils.path_from_environ(key)
 
208
    env = os.environ.get(key)
210
209
    if env:
211
210
        for pair in env.split(os.pathsep):
212
211
            if '@' in pair:
227
226
    'path', or None and one of the values 'user', 'core', 'entrypoints', 'site'.
228
227
    """
229
228
    path_details = []
230
 
    env = osutils.path_from_environ(key)
 
229
    env = os.environ.get(key)
231
230
    defaults = {
232
231
        "user": not env,
233
232
        "core": True,