~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to upstream_import.py

  • Committer: Max Bowsher
  • Date: 2009-11-13 00:43:08 UTC
  • mto: This revision was merged to the branch mainline in revision 739.
  • Revision ID: maxb@f2s.com-20091113004308-4dcwu1kwt3lhf1kp
Having discovered that bzr-builddeb import_dsc.py is a horrid copy-paste job of bzrtools upstream_import.py, restructure the change to minimize divergence from it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
            yield member.name
164
164
 
165
165
 
 
166
def should_ignore(relative_path):
 
167
    return top_path(relative_path) == '.bzr'
 
168
 
 
169
 
166
170
def import_tar(tree, tar_input):
167
171
    """Replace the contents of a working directory with tarfile contents.
168
172
    The tarfile may be a gzipped stream.  File ids will be updated.
201
205
        if prefix is not None:
202
206
            relative_path = relative_path[len(prefix)+1:]
203
207
            relative_path = relative_path.rstrip('/')
204
 
        if relative_path == '.bzr' or relative_path.startswith('.bzr/'):
205
 
            continue
206
208
        if relative_path == '':
207
209
            continue
 
210
        if should_ignore(relative_path):
 
211
            continue
208
212
        add_implied_parents(implied_parents, relative_path)
209
213
        trans_id = tt.trans_id_tree_path(relative_path)
210
214
        added.add(relative_path.rstrip('/'))