~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Lalo Martins
  • Date: 2005-09-08 00:40:15 UTC
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050908004014-bb63b3378ac8ff58
turned get_revision_info into a RevisionSpec class

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.trace import mutter, note, log_error, warning
24
24
from bzrlib.errors import BzrError, BzrCheckError, BzrCommandError
25
25
from bzrlib.branch import find_branch
26
 
from bzrlib.revisionspec import get_revision_info
 
26
from bzrlib.revisionspec import RevisionSpec
27
27
from bzrlib import BZRDIR
28
28
from bzrlib.commands import Command
29
29
 
125
125
        b = find_branch('.')
126
126
 
127
127
        for rev in revs:
128
 
            print '%4d %s' % get_revision_info(b, rev)
 
128
            print '%4d %s' % RevisionSpec(b, rev)
129
129
 
130
130
    
131
131
class cmd_add(Command):
685
685
            rev1 = None
686
686
            rev2 = None
687
687
        elif len(revision) == 1:
688
 
            rev1 = rev2 = get_revision_info(b, revision[0])[0]
 
688
            rev1 = rev2 = RevisionSpec(b, revision[0]).revno
689
689
        elif len(revision) == 2:
690
 
            rev1 = get_revision_info(b, revision[0])[0]
691
 
            rev2 = get_revision_info(b, revision[1])[0]
 
690
            rev1 = RevisionSpec(b, revision[0]).revno
 
691
            rev2 = RevisionSpec(b, revision[1]).revno
692
692
        else:
693
693
            raise BzrCommandError('bzr log --revision takes one or two values.')
694
694
 
861
861
        except ValueError:
862
862
            raise BzrCommandError("not a valid revision-number: %r" % revno)
863
863
 
864
 
        print find_branch('.').lookup_revision(revno)
 
864
        print find_branch('.').get_rev_id(revno)
865
865
 
866
866
 
867
867
class cmd_export(Command):
886
886
        else:
887
887
            if len(revision) != 1:
888
888
                raise BzrError('bzr export --revision takes exactly 1 argument')
889
 
            revno, rev_id = get_revision_info(b, revision[0])
 
889
            rev_id = RevisionSpec(b, revision[0]).rev_id
890
890
        t = b.revision_tree(rev_id)
891
891
        root, ext = os.path.splitext(dest)
892
892
        if not format: