/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 bzrlib/tests/blackbox/test_commit.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 17:48:22 UTC
  • mto: (4987.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125174822-nce4l19sbwx83jvq
Deploying the new overrideAttr facility further reduces the complexity
and make the code clearer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
668
668
 
669
669
    def test_commit_hook_template(self):
670
670
        # Test that commit template hooks work
671
 
        def restoreDefaults():
672
 
            msgeditor.hooks['commit_message_template'] = []
673
 
            osutils.set_or_unset_env('BZR_EDITOR', default_editor)
674
671
        if sys.platform == "win32":
675
672
            f = file('fed.bat', 'w')
676
673
            f.write('@rem dummy fed')
677
674
            f.close()
678
 
            default_editor = osutils.set_or_unset_env('BZR_EDITOR', "fed.bat")
 
675
            osutils.set_or_unset_env('BZR_EDITOR', "fed.bat")
679
676
        else:
680
677
            f = file('fed.sh', 'wb')
681
678
            f.write('#!/bin/sh\n')
682
679
            f.close()
683
680
            os.chmod('fed.sh', 0755)
684
 
            default_editor = osutils.set_or_unset_env('BZR_EDITOR', "./fed.sh")
685
 
        # XXX: And why do we restore a hook ? -- vila 100123
686
 
        self.addCleanup(restoreDefaults)
 
681
            osutils.set_or_unset_env('BZR_EDITOR', "./fed.sh")
687
682
        msgeditor.hooks.install_named_hook("commit_message_template",
688
683
                lambda commit_obj, msg: "save me some typing\n", None)
689
684
        tree = self.make_branch_and_tree('tree')