/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-20 02:17:05 UTC
  • mfrom: (7518.1.2 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200720021705-5f11tmo1hdqjxm6x
Merge lp:brz/3.1.

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

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
 
 
68
54
class RevisionInfo(object):
69
55
    """The results of applying a revision specification to a branch."""
70
56
 
613
599
                self.user_spec, context_branch, 'cannot find the matching revision')
614
600
        parents = parent_map[base_revision_id]
615
601
        if len(parents) < 1:
616
 
            raise InvalidRevisionSpec(
 
602
            raise errors.InvalidRevisionSpec(
617
603
                self.user_spec, context_branch, 'No parents for revision.')
618
604
        return parents[0]
619
605