~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

  • Committer: Vincent Ladeuil
  • Date: 2007-06-26 20:32:49 UTC
  • mto: (2581.1.1 cleanup-runbzr)
  • mto: This revision was merged to the branch mainline in revision 2588.
  • Revision ID: v.ladeuil+lp@free.fr-20070626203249-sqm4afiai5dxofum
Deprecate the varargs syntax and fix the tests.

* bzrlib/tests/__init__.py:
(TestCase.run_bzr): Activate the deprecation warning.
(TestCase.run_bzr_error): Add error_regexes to kwargs or run_bzr
get confused.

* bzrlib/tests/blackbox/test_selftest.py:
(TestRunBzr.test_args): Activate.

* bzrlib/tests/blackbox/test_inventory.py:
(TestInventory.assertInventoryEqual): Build the command from args
if not None.

* bzrlib/tests/blackbox/test_ls.py:
(TestLS.ls_equals): Build the command from args if not None.

* bzrlib/tests/blackbox/test_remove_tree.py:
(TestRemoveTree.test_remove_tree_lightweight_checkout_explicit):
Nice catch, we were calling run_bzr instead of run_bzr_error. This
went unnoticed for some time...

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    def test_merge_reprocess(self):
45
45
        d = BzrDir.create_standalone_workingtree('.')
46
46
        d.commit('h')
47
 
        self.run_bzr('merge', '.', '--reprocess', '--merge-type', 'weave')
 
47
        self.run_bzr('merge . --reprocess --merge-type weave')
48
48
 
49
49
    def test_merge(self):
50
50
        from bzrlib.branch import Branch
106
106
        print >> file('sub/c.txt', 'wb'), "hello"
107
107
        self.run_bzr('init')
108
108
        self.run_bzr('add')
109
 
        self.run_bzr(['commit', '-m', 'added a'])
 
109
        self.run_bzr('commit -m added_a')
110
110
        self.run_bzr('branch . ../b')
111
111
        print >> file('sub/a.txt', 'ab'), "there"
112
112
        print >> file('b.txt', 'ab'), "there"
113
113
        print >> file('sub/c.txt', 'ab'), "there"
114
 
        self.run_bzr(['commit', '-m', 'Added there'])
 
114
        self.run_bzr('commit -m Added_there')
115
115
        os.unlink('sub/a.txt')
116
116
        os.unlink('sub/c.txt')
117
117
        os.rmdir('sub')
118
118
        os.unlink('b.txt')
119
 
        self.run_bzr(['commit', '-m', 'Removed a.txt'])
 
119
        self.run_bzr('commit -m Removed_a.txt')
120
120
        os.chdir('../b')
121
121
        print >> file('sub/a.txt', 'ab'), "something"
122
122
        print >> file('b.txt', 'ab'), "something"
123
123
        print >> file('sub/c.txt', 'ab'), "something"
124
 
        self.run_bzr(['commit', '-m', 'Modified a.txt'])
 
124
        self.run_bzr('commit -m Modified_a.txt')
125
125
        self.run_bzr('merge ../a/', retcode=1)
126
126
        self.assert_(os.path.exists('sub/a.txt.THIS'))
127
127
        self.assert_(os.path.exists('sub/a.txt.BASE'))
233
233
        tree_a.commit('commit 2')
234
234
        tree_a.rename_one('file_2', 'file_ii')
235
235
        ## os.chdir('b')
236
 
        self.run_bzr('merge', 'a', '--uncommitted', '-d', 'b')
 
236
        self.run_bzr('merge a --uncommitted -d b')
237
237
        self.failUnlessExists('b/file_1')
238
238
        self.failUnlessExists('b/file_ii')
239
239
        tree_b.revert([])
240
240
        self.run_bzr_error(('Cannot use --uncommitted and --revision',),
241
 
                           'merge', '/a', '--uncommitted', '-r1',
242
 
                           '-d', 'b')
 
241
                           'merge /a --uncommitted -r1 -d b')
243
242
 
244
243
    def pullable_branch(self):
245
244
        os.mkdir('a')
266
265
    def test_merge_pull(self):
267
266
        self.pullable_branch()
268
267
        os.chdir('a')
269
 
        (out, err) = self.run_bzr('merge', '--pull', '../b')
 
268
        (out, err) = self.run_bzr('merge --pull ../b')
270
269
        self.assertContainsRe(err, 'Now on revision 2\\.')
271
270
        tree_a = WorkingTree.open('.')
272
271
        self.assertEqual([self.id2], tree_a.get_parent_ids())
281
280
        self.build_tree(['tree_a/file/'])
282
281
        tree_a.commit('changed file to directory')
283
282
        os.chdir('tree_b')
284
 
        self.run_bzr('merge', '../tree_a')
 
283
        self.run_bzr('merge ../tree_a')
285
284
        self.assertEqual('directory', file_kind('file'))
286
285
        tree_b.revert([])
287
286
        self.assertEqual('file', file_kind('file'))
288
287
        self.build_tree_contents([('file', 'content_2')])
289
288
        tree_b.commit('content change')
290
 
        self.run_bzr('merge', '../tree_a', retcode=1)
 
289
        self.run_bzr('merge ../tree_a', retcode=1)
291
290
        self.assertEqual(tree_b.conflicts(),
292
291
                         [ContentsConflict('file', file_id='file-id')])