~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Lalo Martins
  • Date: 2005-09-14 05:22:13 UTC
  • mfrom: (1185.1.10)
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050914052213-2aa5c1005959abdf
merging from Robert's integration branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
 
145
145
 
146
146
def show_diff(b, revision, specific_files, external_diff_options=None,
147
 
              revision2=None):
 
147
              revision2=None, output=None):
148
148
    """Shortcut for showing the diff to the working tree.
149
149
 
150
150
    b
156
156
    The more general form is show_diff_trees(), where the caller
157
157
    supplies any two trees.
158
158
    """
159
 
    import sys
 
159
    if output is None:
 
160
        import sys
 
161
        output = sys.stdout
160
162
 
161
163
    if revision is None:
162
164
        old_tree = b.basis_tree()
168
170
    else:
169
171
        new_tree = b.revision_tree(revision2.in_branch(b).rev_id)
170
172
 
171
 
    show_diff_trees(old_tree, new_tree, sys.stdout, specific_files,
 
173
    show_diff_trees(old_tree, new_tree, output, specific_files,
172
174
                    external_diff_options)
173
175
 
174
176