~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-28 07:08:27 UTC
  • mfrom: (2553.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070628070827-h5s313dg5tnag9vj
(robertc) Show the names of commit hooks during commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
359
359
             ('update', 4, 4, 'Running post commit hooks - Stage')],
360
360
            factory._calls
361
361
           )
 
362
 
 
363
    def test_commit_progress_shows_hook_names(self):
 
364
        tree = self.make_branch_and_tree('.')
 
365
        # set a progress bar that captures the calls so we can see what is 
 
366
        # emitted
 
367
        self.old_ui_factory = ui.ui_factory
 
368
        self.addCleanup(self.restoreDefaults)
 
369
        factory = CapturingUIFactory()
 
370
        ui.ui_factory = factory
 
371
        def a_hook(_, _2, _3, _4, _5, _6):
 
372
            pass
 
373
        branch.Branch.hooks.install_hook('post_commit', a_hook)
 
374
        branch.Branch.hooks.name_hook(a_hook, 'hook name')
 
375
        tree.commit('first post')
 
376
        self.assertEqual(
 
377
            [('update', 1, 4, 'Collecting changes [Entry 0/?] - Stage'),
 
378
             ('update', 1, 4, 'Collecting changes [Entry 1/1] - Stage'),
 
379
             ('update', 2, 4, 'Saving data locally - Stage'),
 
380
             ('update', 3, 4, 'Updating the working tree - Stage'),
 
381
             ('update', 4, 4, 'Running post commit hooks - Stage'),
 
382
             ('update', 4, 4, 'Running post commit hooks [hook name] - Stage'),
 
383
             ],
 
384
            factory._calls
 
385
           )