~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Martin Pool
  • Date: 2006-05-19 06:04:00 UTC
  • mfrom: (1714 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1717.
  • Revision ID: mbp@sourcefrog.net-20060519060400-df4657a818d9008a
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1010
1010
        # Eventually it should be replaced with something more
1011
1011
        # accurate.
1012
1012
        
 
1013
        basename = splitpath(filename)[-1]
1013
1014
        for pat in self.get_ignore_list():
1014
1015
            if '/' in pat or '\\' in pat:
1015
1016
                
1016
1017
                # as a special case, you can put ./ at the start of a
1017
1018
                # pattern; this is good to match in the top-level
1018
1019
                # only;
1019
 
                
1020
 
                if (pat[:2] == './') or (pat[:2] == '.\\'):
 
1020
                if pat[:2] in ('./', '.\\'):
1021
1021
                    newpat = pat[2:]
1022
1022
                else:
1023
1023
                    newpat = pat
1024
1024
                if fnmatch.fnmatchcase(filename, newpat):
1025
1025
                    return pat
1026
1026
            else:
1027
 
                if fnmatch.fnmatchcase(splitpath(filename)[-1], pat):
 
1027
                if fnmatch.fnmatchcase(basename, pat):
1028
1028
                    return pat
1029
 
        else:
1030
 
            return None
 
1029
        return None
1031
1030
 
1032
1031
    def kind(self, file_id):
1033
1032
        return file_kind(self.id2abspath(file_id))