~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-06 15:25:11 UTC
  • mfrom: (2319.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070306152511-aa137bb63d6e3a62
(Kent Gibson) Normalize ignore patterns to avoid problems with path seperators.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    delta,
34
34
    config,
35
35
    errors,
 
36
    globbing,
36
37
    ignores,
37
38
    log,
38
39
    merge as _mod_merge,
1792
1793
        if not name_pattern_list:
1793
1794
            raise errors.BzrCommandError("ignore requires at least one "
1794
1795
                                  "NAME_PATTERN or --old-default-rules")
 
1796
        name_pattern_list = [globbing.normalize_pattern(p) 
 
1797
                             for p in name_pattern_list]
1795
1798
        for name_pattern in name_pattern_list:
1796
 
            if name_pattern[0] == '/':
 
1799
            if (name_pattern[0] == '/' or 
 
1800
                (len(name_pattern) > 1 and name_pattern[1] == ':')):
1797
1801
                raise errors.BzrCommandError(
1798
1802
                    "NAME_PATTERN should not be an absolute path")
1799
1803
        tree, relpath = WorkingTree.open_containing(u'.')
1813
1817
        if igns and igns[-1] != '\n':
1814
1818
            igns += '\n'
1815
1819
        for name_pattern in name_pattern_list:
1816
 
            igns += name_pattern.rstrip('/') + '\n'
 
1820
            igns += name_pattern + '\n'
1817
1821
 
1818
1822
        f = AtomicFile(ifn, 'wb')
1819
1823
        try: