~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-08 05:39:46 UTC
  • Revision ID: mbp@sourcefrog.net-20050408053946-1cb3415e1f8f58493034a5cf
- import lovely urlgrabber library

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
 
        r"""Check whether the filename matches an ignore pattern.
 
307
        """Check whether the filename matches an ignore pattern.
308
308
 
309
 
        Patterns containing '/' or '\' need to match the whole path;
310
 
        others match against only the last component.
 
309
        Patterns containing '/' need to match the whole path; others
 
310
        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
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.
 
316
        ## TODO: Use '**' to match directories, and other extended globbing stuff from cvs/rsync.
324
317
        
325
318
        for pat in self.get_ignore_list():
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] == '.\\'):
 
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] == './':
333
323
                    newpat = pat[2:]
334
324
                else:
335
325
                    newpat = pat
349
339
 
350
340
    File text can be retrieved from the text store.
351
341
 
352
 
    TODO: Some kind of `__repr__` method, but a good one
 
342
    :todo: Some kind of `__repr__` method, but a good one
353
343
           probably means knowing the branch and revision number,
354
344
           or at least passing a description to the constructor.
355
345
    """