~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Matthieu Moy
  • Date: 2006-08-06 18:13:16 UTC
  • mto: (1998.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1999.
  • Revision ID: Matthieu.Moy@imag.fr-20060806181316-6e6d46134491e7de
bzr cat now works nicely with revno:N:path too

(even outside a branch or working tree).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1639
1639
        if revision is not None and len(revision) != 1:
1640
1640
            raise BzrCommandError("bzr cat --revision takes exactly one number")
1641
1641
        tree = None
1642
 
        try:
1643
 
            tree, relpath = WorkingTree.open_containing(filename)
1644
 
            b = tree.branch
1645
 
        except NotBranchError:
1646
 
            pass
 
1642
        b = None
 
1643
        if revision is not None and revision[0].get_branch() is not None:
 
1644
            b = Branch.open(revision[0].get_branch())
 
1645
            relpath = filename
 
1646
        else:
 
1647
            try:
 
1648
                tree, relpath = WorkingTree.open_containing(filename)
 
1649
                b = tree.branch
 
1650
            except NotBranchError:
 
1651
                pass
1647
1652
 
1648
 
        if tree is None:
 
1653
        if b is None:
1649
1654
            b, relpath = Branch.open_containing(filename)
1650
1655
        if revision is None:
1651
1656
            revision_id = b.last_revision()