~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to upstream_import.py

  • Committer: Aaron Bentley
  • Date: 2007-06-10 17:55:08 UTC
  • mfrom: (531.2.2 bzrtools)
  • Revision ID: aaron.bentley@utoronto.ca-20070610175508-gex1oxvmfv0qoagi
Merge whitespace cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
 
42
42
class ZipInfoWrapper(object):
43
 
    
 
43
 
44
44
    def __init__(self, zipfile, info):
45
45
        self.info = info
46
46
        self.type = None
108
108
    def isdir(self):
109
109
        return stat.S_ISDIR(self.mode)
110
110
 
111
 
        
 
111
 
112
112
def top_directory(path):
113
113
    """Return the top directory given in a path."""
114
114
    dirname = os.path.dirname(path)
184
184
        tt.delete_contents(trans_id)
185
185
        removed.add(path)
186
186
 
187
 
    added = set() 
 
187
    added = set()
188
188
    implied_parents = set()
189
189
    seen = set()
190
190
    for member in archive_file.getmembers():
191
191
        if member.type == 'g':
192
192
            # type 'g' is a header
193
193
            continue
194
 
        relative_path = member.name 
 
194
        relative_path = member.name
195
195
        if prefix is not None:
196
196
            relative_path = relative_path[len(prefix)+1:]
197
197
            relative_path = relative_path.rstrip('/')
207
207
            tt.cancel_creation(trans_id)
208
208
        seen.add(member.name)
209
209
        if member.isreg():
210
 
            tt.create_file(file_iterator(archive_file.extractfile(member)), 
 
210
            tt.create_file(file_iterator(archive_file.extractfile(member)),
211
211
                           trans_id)
212
212
            executable = (member.mode & 0111) != 0
213
213
            tt.set_executability(executable, trans_id)
257
257
        if tree.changes_from(tree.basis_tree()).has_changed():
258
258
            raise BzrCommandError("Working tree has uncommitted changes.")
259
259
 
260
 
        if (source.endswith('.tar') or source.endswith('.tar.gz') or 
 
260
        if (source.endswith('.tar') or source.endswith('.tar.gz') or
261
261
            source.endswith('.tar.bz2')) or source.endswith('.tgz'):
262
262
            try:
263
263
                if source.endswith('.bz2'):