/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: 2020-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""bzr-upload command implementations."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from ... import (
22
20
    commands,
23
21
    config,
39
37
    )
40
38
""")
41
39
 
42
 
from ...sixish import (
43
 
    text_type,
44
 
    )
45
40
 
46
41
auto_option = config.Option(
47
42
    'upload_auto', default=False, from_unicode=config.bool_from_store,
451
446
            self.set_uploaded_revid(self.rev_id)
452
447
 
453
448
 
454
 
class CannotUploadToWorkingTree(errors.BzrCommandError):
 
449
class CannotUploadToWorkingTree(errors.CommandError):
455
450
 
456
451
    _fmt = 'Cannot upload to a bzr managed working tree: %(url)s".'
457
452
 
458
453
 
459
 
class DivergedUploadedTree(errors.BzrCommandError):
 
454
class DivergedUploadedTree(errors.CommandError):
460
455
 
461
456
    _fmt = ("Your branch (%(revid)s)"
462
457
            " and the uploaded tree (%(uploaded_revid)s) have diverged: ")
483
478
                      help='Branch to upload from, '
484
479
                      'rather than the one containing the working directory.',
485
480
                      short_name='d',
486
 
                      type=text_type,
 
481
                      type=str,
487
482
                      ),
488
483
        option.Option('auto',
489
484
                      'Trigger an upload from this branch whenever the tip '
515
510
            if location is None:
516
511
                stored_loc = conf.get('upload_location')
517
512
                if stored_loc is None:
518
 
                    raise errors.BzrCommandError(
 
513
                    raise errors.CommandError(
519
514
                        'No upload location known or specified.')
520
515
                else:
521
516
                    # FIXME: Not currently tested
543
538
                rev_id = branch.last_revision()
544
539
            else:
545
540
                if len(revision) != 1:
546
 
                    raise errors.BzrCommandError(
 
541
                    raise errors.CommandError(
547
542
                        'bzr upload --revision takes exactly 1 argument')
548
543
                rev_id = revision[0].in_history(branch).rev_id
549
544