~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Martin Pool
  • Date: 2005-05-02 04:24:33 UTC
  • Revision ID: mbp@sourcefrog.net-20050502042433-c825a7f7235f6b15
doc: notes on merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
        `dest` should not exist, and will be created holding the
105
105
        contents of this tree.
106
106
 
107
 
        :todo: To handle subdirectories we need to create the
 
107
        TODO: To handle subdirectories we need to create the
108
108
               directories first.
109
109
 
110
110
        :note: If the export fails, the destination directory will be
304
304
 
305
305
 
306
306
    def is_ignored(self, filename):
307
 
        """Check whether the filename matches an ignore pattern.
 
307
        r"""Check whether the filename matches an ignore pattern.
308
308
 
309
 
        Patterns containing '/' need to match the whole path; others
310
 
        match against only the last component.
 
309
        Patterns containing '/' or '\' need to match the whole path;
 
310
        others match against only the last component.
311
311
 
312
312
        If the file is ignored, returns the pattern which caused it to
313
313
        be ignored, otherwise None.  So this can simply be used as a
314
314
        boolean if desired."""
315
315
 
316
 
        ## TODO: Use '**' to match directories, and other extended globbing stuff from cvs/rsync.
 
316
        # TODO: Use '**' to match directories, and other extended
 
317
        # globbing stuff from cvs/rsync.
 
318
 
 
319
        # XXX: fnmatch is actually not quite what we want: it's only
 
320
        # approximately the same as real Unix fnmatch, and doesn't
 
321
        # treat dotfiles correctly and allows * to match /.
 
322
        # Eventually it should be replaced with something more
 
323
        # accurate.
317
324
        
318
325
        for pat in self.get_ignore_list():
319
 
            if '/' in pat:
320
 
                # as a special case, you can put ./ at the start of a pattern;
321
 
                # this is good to match in the top-level only;
322
 
                if pat[:2] == './':
 
326
            if '/' in pat or '\\' in pat:
 
327
                
 
328
                # as a special case, you can put ./ at the start of a
 
329
                # pattern; this is good to match in the top-level
 
330
                # only;
 
331
                
 
332
                if (pat[:2] == './') or (pat[:2] == '.\\'):
323
333
                    newpat = pat[2:]
324
334
                else:
325
335
                    newpat = pat
339
349
 
340
350
    File text can be retrieved from the text store.
341
351
 
342
 
    :todo: Some kind of `__repr__` method, but a good one
 
352
    TODO: Some kind of `__repr__` method, but a good one
343
353
           probably means knowing the branch and revision number,
344
354
           or at least passing a description to the constructor.
345
355
    """