~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-02 09:14:14 UTC
  • mfrom: (3976.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090202091414-4q20mjzsvp03vyfc
Faster log (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    )
50
50
from bzrlib.branch import Branch
51
51
from bzrlib.conflicts import ConflictList
52
 
from bzrlib.revisionspec import RevisionSpec
 
52
from bzrlib.revisionspec import RevisionSpec, RevisionInfo
53
53
from bzrlib.smtp_connection import SMTPConnection
54
54
from bzrlib.workingtree import WorkingTree
55
55
""")
1972
1972
    elif len(revisionspec_list) == 1:
1973
1973
        rev1 = rev2 = revisionspec_list[0].in_history(branch)
1974
1974
    elif len(revisionspec_list) == 2:
1975
 
        if revisionspec_list[1].get_branch() != revisionspec_list[0
1976
 
                ].get_branch():
 
1975
        start_spec = revisionspec_list[0]
 
1976
        end_spec = revisionspec_list[1]
 
1977
        if end_spec.get_branch() != start_spec.get_branch():
1977
1978
            # b is taken from revision[0].get_branch(), and
1978
1979
            # show_log will use its revision_history. Having
1979
1980
            # different branches will lead to weird behaviors.
1980
1981
            raise errors.BzrCommandError(
1981
1982
                "bzr %s doesn't accept two revisions in different"
1982
1983
                " branches." % command_name)
1983
 
        rev1 = revisionspec_list[0].in_history(branch)
1984
 
        rev2 = revisionspec_list[1].in_history(branch)
 
1984
        rev1 = start_spec.in_history(branch)
 
1985
        # Avoid loading all of history when we know a missing
 
1986
        # end of range means the last revision ...
 
1987
        if end_spec.spec is None:
 
1988
            last_revno, last_revision_id = branch.last_revision_info()
 
1989
            rev2 = RevisionInfo(branch, last_revno, last_revision_id)
 
1990
        else:
 
1991
            rev2 = end_spec.in_history(branch)
1985
1992
    else:
1986
1993
        raise errors.BzrCommandError(
1987
1994
            'bzr %s --revision takes one or two values.' % command_name)