~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Fix ``bzr log -r`` to support selecting merge revisions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1642
1642
                rev1 = None
1643
1643
                rev2 = None
1644
1644
            elif len(revision) == 1:
1645
 
                rev1 = rev2 = revision[0].in_history(b).revno
 
1645
                rev1 = rev2 = revision[0].in_history(b)
1646
1646
            elif len(revision) == 2:
1647
1647
                if revision[1].get_branch() != revision[0].get_branch():
1648
1648
                    # b is taken from revision[0].get_branch(), and
1651
1651
                    raise errors.BzrCommandError(
1652
1652
                        "Log doesn't accept two revisions in different"
1653
1653
                        " branches.")
1654
 
                if revision[0].spec is None:
1655
 
                    # missing begin-range means first revision
1656
 
                    rev1 = 1
1657
 
                else:
1658
 
                    rev1 = revision[0].in_history(b).revno
1659
 
 
1660
 
                if revision[1].spec is None:
1661
 
                    # missing end-range means last known revision
1662
 
                    rev2 = b.revno()
1663
 
                else:
1664
 
                    rev2 = revision[1].in_history(b).revno
 
1654
                rev1 = revision[0].in_history(b)
 
1655
                rev2 = revision[1].in_history(b)
1665
1656
            else:
1666
1657
                raise errors.BzrCommandError(
1667
1658
                    'bzr log --revision takes one or two values.')
1668
1659
 
1669
 
            # By this point, the revision numbers are converted to the +ve
1670
 
            # form if they were supplied in the -ve form, so we can do
1671
 
            # this comparison in relative safety
1672
 
            if rev1 > rev2:
1673
 
                (rev2, rev1) = (rev1, rev2)
1674
 
 
1675
1660
            if log_format is None:
1676
1661
                log_format = log.log_formatter_registry.get_default(b)
1677
1662