~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Danny van Heumen
  • Date: 2010-03-09 21:42:11 UTC
  • mto: (4634.139.5 2.0)
  • mto: This revision was merged to the branch mainline in revision 5160.
  • Revision ID: danny@dannyvanheumen.nl-20100309214211-iqh42x6qcikgd9p3
Reverted now-useless TODO list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
# Authors:  Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
168
168
        tree_a.commit('change n in A')
169
169
 
170
170
        # Merging from A should introduce conflicts because 'n' was modified
171
 
        # (in A) and removed (in B), so 'a' needs to be restored.
 
171
        # and removed, so 'a' needs to be restored.
172
172
        num_conflicts = tree_b.merge_from_branch(tree_a.branch)
173
173
        self.assertEqual(3, num_conflicts)
174
174
        paths = [(path, ie.file_id)
505
505
 
506
506
class TestCommitProgress(TestCaseWithWorkingTree):
507
507
 
508
 
    def setUp(self):
509
 
        super(TestCommitProgress, self).setUp()
510
 
        ui.ui_factory = CapturingUIFactory()
 
508
    def restoreDefaults(self):
 
509
        ui.ui_factory = self.old_ui_factory
511
510
 
512
511
    def test_commit_progress_steps(self):
513
512
        # during commit we one progress update for every entry in the
526
525
        f.close()
527
526
        # set a progress bar that captures the calls so we can see what is
528
527
        # emitted
 
528
        self.old_ui_factory = ui.ui_factory
 
529
        self.addCleanup(self.restoreDefaults)
529
530
        factory = CapturingUIFactory()
530
531
        ui.ui_factory = factory
531
532
        # TODO RBC 20060421 it would be nice to merge the reporter output
547
548
        tree = self.make_branch_and_tree('.')
548
549
        # set a progress bar that captures the calls so we can see what is
549
550
        # emitted
 
551
        self.old_ui_factory = ui.ui_factory
 
552
        self.addCleanup(self.restoreDefaults)
550
553
        factory = CapturingUIFactory()
551
554
        ui.ui_factory = factory
552
555
        def a_hook(_, _2, _3, _4, _5, _6):
570
573
        tree = self.make_branch_and_tree('.')
571
574
        # set a progress bar that captures the calls so we can see what is
572
575
        # emitted
 
576
        self.old_ui_factory = ui.ui_factory
 
577
        self.addCleanup(self.restoreDefaults)
573
578
        factory = CapturingUIFactory()
574
579
        ui.ui_factory = factory
575
580
        def a_hook(_, _2, _3, _4, _5, _6, _7, _8):
616
621
                mutabletree.MutableTree))
617
622
            open(tree.abspath("newfile"), 'w').write("data")
618
623
            params.mutable_tree.add(["newfile"])
 
624
        def restoreDefaults():
 
625
            mutabletree.MutableTree.hooks['post_commit'] = []
 
626
        self.addCleanup(restoreDefaults)
619
627
        tree = self.make_branch_and_tree('.')
620
628
        mutabletree.MutableTree.hooks.install_named_hook(
621
629
            'post_commit',