summaryrefslogtreecommitdiff
path: root/foundry/vcs/hg/providers.py
blob: 232464eeb5590d5c6e04226534abcb3d5764b3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# vim: set filencoding=utf8
"""
SnakeGuice Providers

@author: Mike Crute (mcrute@gmail.com)
@organization: SoftGroup Interactive, Inc.
@date: May 02, 2010
"""

from mercurial import hg
from mercurial.ui import ui
from foundry.utils import implements
from foundry.interfaces import RepositoryProvider


@implements(RepositoryProvider)
class RepoProvider(object):

    def get(self, repo_path=''):
        u = ui()
        u.setconfig('ui', 'report_untrusted', 'off')
        u.setconfig('ui', 'interactive', 'false')

        return hg.repository(u, repo_path)