~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_commit.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
552
552
        """Make sure a start commit hook can modify the tree that is
553
553
        committed."""
554
554
        def start_commit_hook_adds_file(tree):
555
 
            open(tree.abspath("newfile"), 'w').write("data")
 
555
            with open(tree.abspath("newfile"), 'w') as f: f.write("data")
556
556
            tree.add(["newfile"])
557
557
        def restoreDefaults():
558
558
            mutabletree.MutableTree.hooks['start_commit'] = []
573
573
                mutabletree.PostCommitHookParams))
574
574
            self.assertTrue(isinstance(params.mutable_tree,
575
575
                mutabletree.MutableTree))
576
 
            open(tree.abspath("newfile"), 'w').write("data")
 
576
            with open(tree.abspath("newfile"), 'w') as f: f.write("data")
577
577
            params.mutable_tree.add(["newfile"])
578
578
        tree = self.make_branch_and_tree('.')
579
579
        mutabletree.MutableTree.hooks.install_named_hook(