/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: Jelmer Vernooij
  • Date: 2018-11-16 18:35:30 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7178.
  • Revision ID: jelmer@jelmer.uk-20181116183530-ue8yx60h5tinl2wy
Merge more-cleanups.

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
184
        self._up_put_bytes(
185
 
            old_relpath, self.tree.get_file_text(new_relpath, id), mode)
 
185
            old_relpath, self.tree.get_file_text(new_relpath), mode)
186
186
 
187
187
    def _force_clear(self, relpath):
188
188
        try:
201
201
        except errors.PathError:
202
202
            pass
203
203
 
204
 
    def upload_file_robustly(self, relpath, id, mode=None):
 
204
    def upload_file_robustly(self, relpath, mode=None):
205
205
        """Upload a file, clearing the way on the remote side.
206
206
 
207
207
        When doing a full upload, it may happen that a directory exists where
208
208
        we want to put our file.
209
209
        """
210
210
        self._force_clear(relpath)
211
 
        self.upload_file(relpath, relpath, id, mode)
 
211
        self.upload_file(relpath, relpath, mode)
212
212
 
213
213
    def upload_symlink(self, relpath, target):
214
214
        self.to_transport.symlink(target, relpath)
325
325
                        self.outf.write('Ignoring %s\n' % relpath)
326
326
                    continue
327
327
                if ie.kind == 'file':
328
 
                    self.upload_file_robustly(relpath, ie.file_id)
 
328
                    self.upload_file_robustly(relpath)
329
329
                elif ie.kind == 'symlink':
330
330
                    try:
331
331
                        self.upload_symlink_robustly(
388
388
                if content_change:
389
389
                    # We update the old_path content because renames and
390
390
                    # deletions are differed.
391
 
                    self.upload_file(old_path, new_path, id)
 
391
                    self.upload_file(old_path, new_path)
392
392
                self.rename_remote(old_path, new_path)
393
393
            self.finish_renames()
394
394
            self.finish_deletions()
406
406
                    raise NotImplementedError
407
407
 
408
408
                if new_kind == 'file':
409
 
                    self.upload_file(path, path, id)
 
409
                    self.upload_file(path, path)
410
410
                elif new_kind == 'symlink':
411
411
                    target = self.tree.get_symlink_target(path)
412
412
                    self.upload_symlink(path, target)
421
421
                        self.outf.write('Ignoring %s\n' % path)
422
422
                    continue
423
423
                if kind == 'file':
424
 
                    self.upload_file(path, path, id)
 
424
                    self.upload_file(path, path)
425
425
                elif kind == 'directory':
426
426
                    self.make_remote_dir(path)
427
427
                elif kind == 'symlink':
443
443
                        self.outf.write('Ignoring %s\n' % path)
444
444
                    continue
445
445
                if kind == 'file':
446
 
                    self.upload_file(path, path, id)
 
446
                    self.upload_file(path, path)
447
447
                elif kind == 'symlink':
448
448
                    target = self.tree.get_symlink_target(path)
449
449
                    self.upload_symlink(path, target)