~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: 2007-06-07 00:21:24 UTC
  • mfrom: (2514.1.1 bzr.ab.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070607002124-64z9d0o6x0e9iwbl
Various fixes for revision-info (Metthew Fuller)

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    osutils,
46
46
    registry,
47
47
    repository,
 
48
    revisionspec,
48
49
    symbol_versioning,
49
50
    transport,
50
51
    tree as _mod_tree,
304
305
        if revision_info_list is not None:
305
306
            for rev in revision_info_list:
306
307
                revs.append(RevisionSpec.from_string(rev))
 
308
 
 
309
        b = Branch.open_containing(u'.')[0]
 
310
 
307
311
        if len(revs) == 0:
308
 
            raise errors.BzrCommandError('You must supply a revision identifier')
309
 
 
310
 
        b = WorkingTree.open_containing(u'.')[0].branch
 
312
            revs.append(RevisionSpec.from_string('-1'))
311
313
 
312
314
        for rev in revs:
313
315
            revinfo = rev.in_history(b)
314
316
            if revinfo.revno is None:
315
 
                print '     %s' % revinfo.rev_id
 
317
                dotted_map = b.get_revision_id_to_revno_map()
 
318
                revno = '.'.join(str(i) for i in dotted_map[revinfo.rev_id])
 
319
                print '%s %s' % (revno, revinfo.rev_id)
316
320
            else:
317
321
                print '%4d %s' % (revinfo.revno, revinfo.rev_id)
318
322