104
104
`dest` should not exist, and will be created holding the
105
105
contents of this tree.
107
TODO: To handle subdirectories we need to create the
107
:todo: To handle subdirectories we need to create the
108
108
directories first.
110
110
:note: If the export fails, the destination directory will be
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.
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.
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."""
316
# TODO: Use '**' to match directories, and other extended
317
# globbing stuff from cvs/rsync.
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
316
## TODO: Use '**' to match directories, and other extended globbing stuff from cvs/rsync.
325
318
for pat in self.get_ignore_list():
326
if '/' in pat or '\\' in pat:
328
# as a special case, you can put ./ at the start of a
329
# pattern; this is good to match in the top-level
332
if (pat[:2] == './') or (pat[:2] == '.\\'):
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;
350
340
File text can be retrieved from the text store.
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.