~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-17 07:59:54 UTC
  • Revision ID: mbp@sourcefrog.net-20050517075954-fca3ac7ce3b6d901
- refactor log command
- log runs from most-recent to least now
  (reverse from previously)
- log -v and log on specific file temporarily broken

Show diffs side-by-side

added added

removed removed

Lines of Context:
587
587
 
588
588
    TODO: Option to limit range.
589
589
 
590
 
    TODO: Perhaps show most-recent first with an option for last.
 
590
    TODO: Option to show in forward order.
591
591
    """
592
592
    takes_args = ['filename?']
593
593
    takes_options = ['timezone', 'verbose', 'show-ids']
594
594
    def run(self, filename=None, timezone='original', verbose=False, show_ids=False):
595
 
        from branch import find_branch
596
 
        b = find_branch((filename or '.'), lock_mode='r')
 
595
        from bzrlib import show_log, find_branch
 
596
        
597
597
        if filename:
598
 
            filename = b.relpath(filename)
599
 
        bzrlib.show_log(b, filename,
600
 
                        show_timezone=timezone,
601
 
                        verbose=verbose,
602
 
                        show_ids=show_ids)
 
598
            b = find_branch(filename, lock_mode='r')
 
599
            fp = b.relpath(filename)
 
600
            file_id = b.read_working_inventory().path2id(fp)
 
601
        else:
 
602
            b = find_branch('.', lock_mode='r')
 
603
            file_id = None
 
604
 
 
605
        show_log(b, file_id,
 
606
                 show_timezone=timezone,
 
607
                 verbose=verbose,
 
608
                 show_ids=show_ids,
 
609
                 to_file=sys.stdout)
603
610
 
604
611
 
605
612