/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/revisionspec.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:
51
51
            self.extra = ''
52
52
 
53
53
 
 
54
class InvalidRevisionSpec(errors.BzrError):
 
55
 
 
56
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
 
57
            " %(branch_url)s%(extra)s")
 
58
 
 
59
    def __init__(self, spec, branch, extra=None):
 
60
        errors.BzrError.__init__(self, branch=branch, spec=spec)
 
61
        self.branch_url = getattr(branch, 'user_url', str(branch))
 
62
        if extra:
 
63
            self.extra = '\n' + str(extra)
 
64
        else:
 
65
            self.extra = ''
 
66
 
 
67
 
54
68
class RevisionInfo(object):
55
69
    """The results of applying a revision specification to a branch."""
56
70
 
599
613
                self.user_spec, context_branch, 'cannot find the matching revision')
600
614
        parents = parent_map[base_revision_id]
601
615
        if len(parents) < 1:
602
 
            raise errors.InvalidRevisionSpec(
 
616
            raise InvalidRevisionSpec(
603
617
                self.user_spec, context_branch, 'No parents for revision.')
604
618
        return parents[0]
605
619