~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

merge bzr.dev@3890

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
    """
393
393
    hidden = True
394
394
    takes_args = ['revision_info*']
395
 
    takes_options = ['revision']
 
395
    takes_options = [
 
396
        'revision',
 
397
        Option('directory',
 
398
            help='Branch to examine, '
 
399
                 'rather than the one containing the working directory.',
 
400
            short_name='d',
 
401
            type=unicode,
 
402
            ),
 
403
        ]
396
404
 
397
405
    @display_command
398
 
    def run(self, revision=None, revision_info_list=[]):
 
406
    def run(self, revision=None, directory=u'.', revision_info_list=[]):
399
407
 
400
408
        revs = []
401
409
        if revision is not None:
404
412
            for rev in revision_info_list:
405
413
                revs.append(RevisionSpec.from_string(rev))
406
414
 
407
 
        b = Branch.open_containing(u'.')[0]
 
415
        b = Branch.open_containing(directory)[0]
408
416
 
409
417
        if len(revs) == 0:
410
418
            revs.append(RevisionSpec.from_string('-1'))
798
806
                    result.old_revid))
799
807
                old_rh.reverse()
800
808
                new_rh = branch_to.revision_history()
 
809
                log_format = branch_to.get_config().log_format()
801
810
                log.show_changed_revisions(branch_to, old_rh, new_rh,
802
 
                                           to_file=self.outf)
 
811
                                           to_file=self.outf,
 
812
                                           log_format=log_format)
803
813
        finally:
804
814
            branch_to.unlock()
805
815
 
1976
1986
                        continue
1977
1987
                    if kind is not None and fkind != kind:
1978
1988
                        continue
 
1989
                    kindch = entry.kind_character()
 
1990
                    outstring = fp + kindch
1979
1991
                    if verbose:
1980
 
                        kindch = entry.kind_character()
1981
 
                        outstring = '%-8s %s%s' % (fc, fp, kindch)
 
1992
                        outstring = '%-8s %s' % (fc, outstring)
1982
1993
                        if show_ids and fid is not None:
1983
1994
                            outstring = "%-50s %s" % (outstring, fid)
1984
1995
                        self.outf.write(outstring + '\n')
1995
2006
                        else:
1996
2007
                            my_id = ''
1997
2008
                        if show_ids:
1998
 
                            self.outf.write('%-50s %s\n' % (fp, my_id))
 
2009
                            self.outf.write('%-50s %s\n' % (outstring, my_id))
1999
2010
                        else:
2000
 
                            self.outf.write(fp + '\n')
 
2011
                            self.outf.write(outstring + '\n')
2001
2012
        finally:
2002
2013
            tree.unlock()
2003
2014