~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/rules.py

  • Committer: John Ferlito
  • Date: 2009-09-02 04:31:45 UTC
  • mto: (4665.7.1 serve-init)
  • mto: This revision was merged to the branch mainline in revision 4913.
  • Revision ID: johnf@inodes.org-20090902043145-gxdsfw03ilcwbyn5
Add a debian init script for bzr --serve

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
21
21
 
22
22
from bzrlib import (
23
23
    config,
24
 
    cmdline,
 
24
    commands,
25
25
    errors,
26
26
    globbing,
27
27
    osutils,
74
74
 
75
75
        :param inifile: the name of the file or a sequence of lines.
76
76
        """
77
 
        self._cfg = configobj.ConfigObj(inifile, encoding='utf-8')
 
77
        options = {'encoding': 'utf-8'}
 
78
        self._cfg = configobj.ConfigObj(inifile, options=options)
78
79
        sections = self._cfg.keys()
79
80
        patterns = []
80
81
        self.pattern_to_section = {}
81
82
        for s in sections:
82
83
            if s.startswith(FILE_PREFS_PREFIX):
83
 
                file_patterns = cmdline.split(s[FILE_PREFS_PREFIX_LEN:])
 
84
                file_patterns = commands.shlex_split_unicode(
 
85
                    s[FILE_PREFS_PREFIX_LEN:])
84
86
                patterns.extend(file_patterns)
85
87
                for fp in file_patterns:
86
88
                    self.pattern_to_section[fp] = s