/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/upstream_import.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 19:47:19 UTC
  • mfrom: (7178 work)
  • mto: This revision was merged to the branch mainline in revision 7179.
  • Revision ID: jelmer@jelmer.uk-20181116194719-m5ut2wfuze5x9s1p
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import errno
22
22
from io import (
23
23
    BytesIO,
24
 
    StringIO,
25
24
    )
26
25
import os
27
26
import re
75
74
 
76
75
    def add(self, filename):
77
76
        if isdir(filename):
78
 
            self.zipfile.writestr(filename+'/', '')
 
77
            self.zipfile.writestr(filename + '/', '')
79
78
        else:
80
79
            self.zipfile.write(filename)
81
80
 
220
219
    tar_file = tarfile.open('lala', 'r', tar_input)
221
220
    import_archive(tree, tar_file)
222
221
 
 
222
 
223
223
def import_zip(tree, zip_input):
224
224
    zip_file = ZipFileWrapper(zip_input, 'r')
225
225
    import_archive(tree, zip_file)
263
263
        if not isinstance(relative_path, text_type):
264
264
            relative_path = relative_path.decode('utf-8')
265
265
        if prefix is not None:
266
 
            relative_path = relative_path[len(prefix)+1:]
 
266
            relative_path = relative_path[len(prefix) + 1:]
267
267
            relative_path = relative_path.rstrip('/')
268
268
        if relative_path == '':
269
269
            continue