~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Robert Collins
  • Date: 2005-09-06 09:50:31 UTC
  • mto: (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050906095031-251e9bdf97a4817f
make show_diff redirectable

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 == None:
162
164
        old_tree = b.basis_tree()
168
170
    else:
169
171
        new_tree = b.revision_tree(b.lookup_revision(revision2))
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