/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 config.py

Some more test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    """BranchConfig that uses locations.conf in place of branch.conf"""
25
25
 
26
26
    def __init__(self, branch):
27
 
        config.BranchConfig.__init__(self, branch)
 
27
        super(GitBranchConfig, self).__init__(branch)
28
28
        # do not provide a BranchDataConfig
29
29
        self.option_sources = self.option_sources[0], self.option_sources[2]
30
30
 
 
31
    def __repr__(self):
 
32
        return "<%s of %r>" % (self.__class__.__name__, self.branch)
 
33
 
31
34
    def set_user_option(self, name, value, store=config.STORE_BRANCH,
32
35
            warn_masked=False):
33
36
        """Force local to True"""
37
40
    def _get_user_id(self):
38
41
        # TODO: Read from ~/.gitconfig
39
42
        return self._get_best_value('_get_user_id')
 
43
 
 
44
 
 
45
class GitBranchStack(config._CompatibleStack):
 
46
    """GitBranch stack."""
 
47
 
 
48
    def __init__(self, branch):
 
49
        lstore = config.LocationStore()
 
50
        loc_matcher = config.LocationMatcher(lstore, branch.base)
 
51
        # FIXME: This should also be looking in .git/config for
 
52
        # local git branches.
 
53
        gstore = config.GlobalStore()
 
54
        super(GitBranchStack, self).__init__(
 
55
            [self._get_overrides,
 
56
             loc_matcher.get_sections,
 
57
             gstore.get_sections],
 
58
            # All modifications go to the corresponding section in
 
59
            # locations.conf
 
60
            lstore, branch.base)
 
61
        self.branch = branch