~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_merger.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import (
23
23
    errors,
24
24
    merge as _mod_merge,
25
 
    option,
26
25
    )
27
26
from bzrlib.tests import (
28
27
    multiply_tests,
38
37
    result = loader.suiteClass()
39
38
    scenarios = [
40
39
        (name, {'merge_type': merger})
41
 
        for name, merger in option._merge_type_registry.items()]
 
40
        for name, merger in _mod_merge.merge_type_registry.items()]
42
41
    return multiply_tests(standard_tests, scenarios, result)
43
42
 
44
43
 
175
174
        transform.finalize()
176
175
        return (limbodir, deletiondir)
177
176
 
178
 
    def test_merge_with_existing_limbo(self):
179
 
        wt = self.make_branch_and_tree('this')
180
 
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
181
 
        os.mkdir(limbodir)
 
177
    def test_merge_with_existing_limbo_empty(self):
 
178
        """Empty limbo dir is just cleaned up - see bug 427773"""
 
179
        wt = self.make_branch_and_tree('this')
 
180
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
181
        os.mkdir(limbodir)
 
182
        self.do_merge(wt, wt)
 
183
 
 
184
    def test_merge_with_existing_limbo_non_empty(self):
 
185
        wt = self.make_branch_and_tree('this')
 
186
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
187
        os.mkdir(limbodir)
 
188
        os.mkdir(os.path.join(limbodir, 'something'))
182
189
        self.assertRaises(errors.ExistingLimbo, self.do_merge, wt, wt)
183
190
        self.assertRaises(errors.LockError, wt.unlock)
184
191
 
185
 
    def test_merge_with_pending_deletion(self):
186
 
        wt = self.make_branch_and_tree('this')
187
 
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
188
 
        os.mkdir(deletiondir)
 
192
    def test_merge_with_pending_deletion_empty(self):
 
193
        wt = self.make_branch_and_tree('this')
 
194
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
195
        os.mkdir(deletiondir)
 
196
        self.do_merge(wt, wt)
 
197
 
 
198
    def test_merge_with_pending_deletion_non_empty(self):
 
199
        """Also see bug 427773"""
 
200
        wt = self.make_branch_and_tree('this')
 
201
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
202
        os.mkdir(deletiondir)
 
203
        os.mkdir(os.path.join(deletiondir, 'something'))
189
204
        self.assertRaises(errors.ExistingPendingDeletion, self.do_merge, wt, wt)
190
205
        self.assertRaises(errors.LockError, wt.unlock)
191
206
 
194
209
    """Tests that the 'merge_file_content' hook is invoked."""
195
210
 
196
211
    def setUp(self):
197
 
        TestCaseWithTransport.setUp(self)
 
212
        super(TestHookMergeFileContent, self).setUp()
198
213
        self.hook_log = []
199
214
 
200
215
    def install_hook_inactive(self):