~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-01-28 13:24:39 UTC
  • mfrom: (6450.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20120128132439-phvlss4cq7bf5rji
(jelmer) Merge the 2.5 branch. (Jelmer Vernooij)

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(