/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/plugins/upload/cmds.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 15:19:49 UTC
  • mfrom: (7141.7.6 no-file-ids)
  • Revision ID: breezy.the.bot@gmail.com-20181116151949-hrmuv6s7ow1cqdhi
Drop file_id argument from read functions in Tree.

Merged from https://code.launchpad.net/~jelmer/brz/no-file-ids/+merge/357984

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
                    dir = os.path.dirname(dir)
174
174
        return ignored
175
175
 
176
 
    def upload_file(self, old_relpath, new_relpath, id, mode=None):
 
176
    def upload_file(self, old_relpath, new_relpath, mode=None):
177
177
        if mode is None:
178
 
            if self.tree.is_executable(new_relpath, id):
 
178
            if self.tree.is_executable(new_relpath):
179
179
                mode = 0o775
180
180
            else:
181
181
                mode = 0o664
182
182
        if not self.quiet:
183
183
            self.outf.write('Uploading %s\n' % old_relpath)
184
 
        self._up_put_bytes(old_relpath, self.tree.get_file_text(new_relpath, id), mode)
 
184
        self._up_put_bytes(old_relpath, self.tree.get_file_text(new_relpath), mode)
185
185
 
186
186
    def _force_clear(self, relpath):
187
187
        try:
200
200
        except errors.PathError:
201
201
            pass
202
202
 
203
 
    def upload_file_robustly(self, relpath, id, mode=None):
 
203
    def upload_file_robustly(self, relpath, mode=None):
204
204
        """Upload a file, clearing the way on the remote side.
205
205
 
206
206
        When doing a full upload, it may happen that a directory exists where
207
207
        we want to put our file.
208
208
        """
209
209
        self._force_clear(relpath)
210
 
        self.upload_file(relpath, relpath, id, mode)
 
210
        self.upload_file(relpath, relpath, mode)
211
211
 
212
212
    def upload_symlink(self, relpath, target):
213
213
        self.to_transport.symlink(target, relpath)
324
324
                        self.outf.write('Ignoring %s\n' % relpath)
325
325
                    continue
326
326
                if ie.kind == 'file':
327
 
                    self.upload_file_robustly(relpath, ie.file_id)
 
327
                    self.upload_file_robustly(relpath)
328
328
                elif ie.kind == 'symlink':
329
329
                    try:
330
330
                        self.upload_symlink_robustly(relpath, ie.symlink_target)
386
386
                if content_change:
387
387
                    # We update the old_path content because renames and
388
388
                    # deletions are differed.
389
 
                    self.upload_file(old_path, new_path, id)
 
389
                    self.upload_file(old_path, new_path)
390
390
                self.rename_remote(old_path, new_path)
391
391
            self.finish_renames()
392
392
            self.finish_deletions()
404
404
                    raise NotImplementedError
405
405
 
406
406
                if new_kind == 'file':
407
 
                    self.upload_file(path, path, id)
 
407
                    self.upload_file(path, path)
408
408
                elif new_kind == 'symlink':
409
409
                    target = self.tree.get_symlink_target(path)
410
410
                    self.upload_symlink(path, target)
419
419
                        self.outf.write('Ignoring %s\n' % path)
420
420
                    continue
421
421
                if kind == 'file':
422
 
                    self.upload_file(path, path, id)
 
422
                    self.upload_file(path, path)
423
423
                elif kind == 'directory':
424
424
                    self.make_remote_dir(path)
425
425
                elif kind == 'symlink':
441
441
                        self.outf.write('Ignoring %s\n' % path)
442
442
                    continue
443
443
                if kind == 'file':
444
 
                    self.upload_file(path, path, id)
 
444
                    self.upload_file(path, path)
445
445
                elif kind == 'symlink':
446
446
                    target = self.tree.get_symlink_target(path)
447
447
                    self.upload_symlink(path, target)