~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Lalo Martins
  • Date: 2005-09-09 18:59:17 UTC
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050913094215-c9b1ceb71213cf51
polishing up the RevisionSpec api, as per suggestions from Robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        b = Branch.open_containing('.')
126
126
 
127
127
        for rev in revs:
128
 
            print '%4d %s' % RevisionSpec(b, rev)
 
128
            print '%4d %s' % RevisionSpec(rev).in_history(b)
129
129
 
130
130
    
131
131
class cmd_add(Command):
199
199
            if len(revision) > 1:
200
200
                raise BzrCommandError('bzr inventory --revision takes'
201
201
                    ' exactly one revision identifier')
202
 
            inv = b.get_revision_inventory(RevisionSpec(b, revision[0]).rev_id)
 
202
            spec = RevisionSpec(revision[0])
 
203
            inv = b.get_revision_inventory(spec.in_history(b).rev_id)
203
204
 
204
205
        for path, entry in inv.entries():
205
206
            if show_ids:
687
688
            rev1 = None
688
689
            rev2 = None
689
690
        elif len(revision) == 1:
690
 
            rev1 = rev2 = RevisionSpec(b, revision[0]).revno
 
691
            rev1 = rev2 = RevisionSpec(revision[0]).in_history(b).revno
691
692
        elif len(revision) == 2:
692
 
            rev1 = RevisionSpec(b, revision[0]).revno
693
 
            rev2 = RevisionSpec(b, revision[1]).revno
 
693
            rev1 = RevisionSpec(revision[0]).in_history(b).revno
 
694
            rev2 = RevisionSpec(revision[1]).in_history(b).revno
694
695
        else:
695
696
            raise BzrCommandError('bzr log --revision takes one or two values.')
696
697
 
750
751
        if revision == None:
751
752
            tree = b.working_tree()
752
753
        else:
753
 
            tree = b.revision_tree(RevisionSpec(b, revision).rev_id)
 
754
            tree = b.revision_tree(RevisionSpec(revision).in_history(b).rev_id)
754
755
 
755
756
        for fp, fc, kind, fid in tree.list_files():
756
757
            if verbose:
888
889
        else:
889
890
            if len(revision) != 1:
890
891
                raise BzrError('bzr export --revision takes exactly 1 argument')
891
 
            rev_id = RevisionSpec(b, revision[0]).rev_id
 
892
            rev_id = RevisionSpec(revision[0]).in_history(b).rev_id
892
893
        t = b.revision_tree(rev_id)
893
894
        root, ext = os.path.splitext(dest)
894
895
        if not format:
1187
1188
        else:
1188
1189
            if len(revision) == 1:
1189
1190
                base = [None, None]
1190
 
                other = [branch, RevisionSpec(branch, revision[0]).revno]
 
1191
                spec = RevisionSpec(revision[0])
 
1192
                other = [branch, spec.in_history(branch).revno]
1191
1193
            else:
1192
1194
                assert len(revision) == 2
1193
1195
                if None in revision:
1194
1196
                    raise BzrCommandError(
1195
1197
                        "Merge doesn't permit that revision specifier.")
1196
 
                base = [branch, RevisionSpec(branch, revision[0]).revno]
1197
 
                other = [branch, RevisionSpec(branch, revision[1]).revno]
 
1198
                spec = RevisionSpec(revision[0])
 
1199
                base = [branch, spec.in_history(branch).revno]
 
1200
                spec = RevisionSpec(revision[1])
 
1201
                other = [branch, spec.in_history(branch).revno]
1198
1202
 
1199
1203
        try:
1200
1204
            merge(other, base, check_clean=(not force), merge_type=merge_type)