/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 breezy/diff.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-25 11:54:30 UTC
  • mfrom: (6855.4.10 more-bees)
  • Revision ID: breezy.the.bot@gmail.com-20180325115430-75xnlbrmzjoomd83
Add more bees. In particular:

* for file ids
* for revision ids
* for file contents in build_tree_contents()

Merged from https://code.launchpad.net/~jelmer/brz/more-bees/+merge/337919

Show diffs side-by-side

added added

removed removed

Lines of Context:
816
816
                raise
817
817
        source = tree.get_file(relpath, file_id)
818
818
        try:
819
 
            target = open(full_path, 'wb')
820
 
            try:
 
819
            with open(full_path, 'wb') as target:
821
820
                osutils.pumpfile(source, target)
822
 
            finally:
823
 
                target.close()
824
821
        finally:
825
822
            source.close()
826
823
        try:
871
868
                file_id=file_id)
872
869
        command = self._get_command(old_abs_path, new_abs_path)
873
870
        subprocess.call(command, cwd=self._root)
874
 
        new_file = open(new_abs_path, 'rb')
875
 
        try:
 
871
        with open(new_abs_path, 'rb') as new_file:
876
872
            return new_file.read()
877
 
        finally:
878
 
            new_file.close()
879
873
 
880
874
 
881
875
class DiffTree(object):