~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Aaron Bentley
  • Date: 2009-08-14 15:51:25 UTC
  • mto: (4603.1.22 shelve-editor)
  • mto: This revision was merged to the branch mainline in revision 4795.
  • Revision ID: aaron@aaronbentley.com-20090814155125-wt1ox94v6b8gml52
Simplify editing a file with a differ.

Show diffs side-by-side

added added

removed removed

Lines of Context:
765
765
        components.extend(['new', new_path])
766
766
        return osutils.pathjoin(*components)
767
767
 
 
768
    def read_new_file(self, new_path):
 
769
        new_abs_path = self.get_new_path(new_path, abspath=True)
 
770
        new_file = open(new_abs_path, 'r')
 
771
        try:
 
772
            return new_file.read()
 
773
        finally:
 
774
            new_file.close()
 
775
 
768
776
 
769
777
class DiffTree(object):
770
778
    """Provides textual representations of the difference between two trees.