/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Robert Collins
  • Date: 2005-09-12 12:39:58 UTC
  • mfrom: (1185.3.4)
  • mto: (1185.1.10)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050912123958-7982e808f291f439
merge up with head

Show diffs side-by-side

added added

removed removed

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