~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/__init__.py

  • Committer: Martin Pool
  • Date: 2009-03-03 03:01:49 UTC
  • mfrom: (4070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4073.
  • Revision ID: mbp@sourcefrog.net-20090303030149-8p8o8hszdtqa7w8f
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    """Register an exporter.
33
33
 
34
34
    :param format: This is the name of the format, such as 'tgz' or 'zip'
35
 
    :param extensions: Extensions which should be used in the case that a 
 
35
    :param extensions: Extensions which should be used in the case that a
36
36
                       format was not explicitly specified.
37
37
    :type extensions: List
38
38
    :param func: The function. It will be called with (tree, dest, root)
70
70
    :param format: The format (dir, zip, etc), if None, it will check the
71
71
                   extension on dest, looking for a match
72
72
    :param root: The root location inside the format.
73
 
                 It is common practise to have zipfiles and tarballs 
 
73
                 It is common practise to have zipfiles and tarballs
74
74
                 extract into a subdirectory, rather than into the
75
75
                 current working directory.
76
76
                 If root is None, the default root will be
151
151
        # .bzrignore and .bzrrules - do not export these
152
152
        if entry[0].startswith(".bzr"):
153
153
            continue
 
154
        if subdir is None:
 
155
            if not tree.has_filename(entry[0]):
 
156
                continue
 
157
        else:
 
158
            if not tree.has_filename(os.path.join(subdir, entry[0])):
 
159
                continue
154
160
        yield entry
155
161
 
156
162