~vcs-imports/meld/trunk

« back to all changes in this revision

Viewing changes to vc/__init__.py

  • Committer: vincele
  • Date: 2009-04-11 22:30:33 UTC
  • Revision ID: vcs-imports@canonical.com-20090411223033-dyz43fnasae06chn
Remove the hardcoded default VC file filter, construct one
from the actually supported plugins metadata.

The misc.py shell_escape() function should be
implemented by python stdlib fnmatch module,
the current, incomplete, local version will do
until this goes upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    return ret
35
35
_plugins = load_plugins()
36
36
 
 
37
def get_plugins_metadata():
 
38
    ret = []
 
39
    for p in _plugins:
 
40
        # Some plugins have VC_DIR=None until instantiated
 
41
        if p.Vc.VC_DIR:
 
42
            ret.append(p.Vc.VC_DIR)
 
43
        # Most plugins have VC_METADATA=None
 
44
        if p.Vc.VC_METADATA:
 
45
            ret.extend(p.Vc.VC_METADATA)
 
46
    return ret
 
47
 
37
48
def get_vcs(location):
38
49
    """Pick only the Vcs with the longest repo root
39
50