~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-20 02:16:01 UTC
  • Revision ID: mbp@sourcefrog.net-20050520021601-d931cce5b66227a3
- bzr diff finds a branch from the first parameter,
  if any are given

Show diffs side-by-side

added added

removed removed

Lines of Context:
493
493
 
494
494
    def run(self, revision=None, file_list=None):
495
495
        from bzrlib.diff import show_diff
 
496
        from bzrlib import find_branch
 
497
 
 
498
        if file_list:
 
499
            b = find_branch(file_list[0], lock_mode='r')
 
500
            file_list = [b.relpath(f) for f in file_list]
 
501
            if file_list == ['']:
 
502
                # just pointing to top-of-tree
 
503
                file_list = None
 
504
        else:
 
505
            b = Branch('.', lock_mode='r')
496
506
    
497
 
        show_diff(Branch('.', lock_mode='r'), revision, specific_files=file_list)
 
507
        show_diff(b, revision, specific_files=file_list)
498
508
 
499
509
 
500
510