~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(gz) Enable use of 3-way conflict markers in pull and update by adding
 --show-base option (Rory Yorke)

Show diffs side-by-side

added added

removed removed

Lines of Context:
359
359
2>Updated to revision 2 of branch .../master
360
360
''')
361
361
 
 
362
    def test_update_show_base(self):
 
363
        """bzr update support --show-base
 
364
 
 
365
        see https://bugs.launchpad.net/bzr/+bug/202374"""
 
366
 
 
367
        tree=self.make_branch_and_tree('.')
 
368
 
 
369
        f = open('hello','wt')
 
370
        f.write('foo')
 
371
        f.close()
 
372
        tree.add('hello')
 
373
        tree.commit('fie')
 
374
 
 
375
        f = open('hello','wt')
 
376
        f.write('fee')
 
377
        f.close()
 
378
        tree.commit('fee')
 
379
 
 
380
        #tree.update() gives no such revision, so ...
 
381
        self.run_bzr(['update','-r1'])
 
382
 
 
383
        #create conflict
 
384
        f = open('hello','wt')
 
385
        f.write('fie')
 
386
        f.close()
 
387
 
 
388
        out, err = self.run_bzr(['update','--show-base'],retcode=1)
 
389
 
 
390
        # check for conflict notification
 
391
        self.assertContainsString(err,
 
392
                                  ' M  hello\nText conflict in hello\n1 conflicts encountered.\n')
 
393
        
 
394
        self.assertEqualDiff('<<<<<<< TREE\n'
 
395
                             'fie||||||| BASE-REVISION\n'
 
396
                             'foo=======\n'
 
397
                             'fee>>>>>>> MERGE-SOURCE\n',
 
398
                             open('hello').read())
 
399
 
362
400
    def test_update_checkout_prevent_double_merge(self):
363
401
        """"Launchpad bug 113809 in bzr "update performs two merges"
364
402
        https://launchpad.net/bugs/113809"""