~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-01-31 15:43:17 UTC
  • mfrom: (6437.3.28 2.5)
  • mto: (6437.23.1 2.5)
  • mto: This revision was merged to the branch mainline in revision 6458.
  • Revision ID: jelmer@samba.org-20120131154317-y028tz0r9xesvn9p
MergeĀ 2.5.

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(