/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 bzrlib/builtins.py

  • Committer: Kent Gibson
  • Date: 2007-03-01 08:46:00 UTC
  • mto: (2319.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2320.
  • Revision ID: warthog618@gmail.com-20070301084600-mce8y9te2o548h5r
Normalise ignore patterns to use '/' path separator.
Also fixes bug 86451 where a trailing '\' crashes pattern matching.
Added detection and correction of trailing '\' in ignore REs that would
escape the closing bracket.

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,
1789
1790
        if not name_pattern_list:
1790
1791
            raise errors.BzrCommandError("ignore requires at least one "
1791
1792
                                  "NAME_PATTERN or --old-default-rules")
 
1793
        name_pattern_list = [ globbing.normalize_pattern(x) 
 
1794
            for x in name_pattern_list ]
1792
1795
        for name_pattern in name_pattern_list:
1793
 
            if name_pattern[0] == '/':
 
1796
            if (name_pattern[0] == '/' or 
 
1797
                (len(name_pattern) > 1 and name_pattern[1] == ':')):
1794
1798
                raise errors.BzrCommandError(
1795
1799
                    "NAME_PATTERN should not be an absolute path")
1796
1800
        tree, relpath = WorkingTree.open_containing(u'.')
1810
1814
        if igns and igns[-1] != '\n':
1811
1815
            igns += '\n'
1812
1816
        for name_pattern in name_pattern_list:
1813
 
            igns += name_pattern.rstrip('/') + '\n'
 
1817
            igns += name_pattern + '\n'
1814
1818
 
1815
1819
        f = AtomicFile(ifn, 'wb')
1816
1820
        try: