~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
Updated to revision 1 of branch %s
91
91
""" % osutils.pathjoin(self.test_dir, 'branch',),
92
92
                         err)
93
 
        self.failUnlessExists('branch/file')
 
93
        self.assertPathExists('branch/file')
94
94
 
95
95
    def test_update_out_of_date_light_checkout(self):
96
96
        self.make_branch_and_tree('branch')
179
179
""" % osutils.pathjoin(self.test_dir, 'master',),
180
180
                         err)
181
181
        self.assertEqual([master_tip, child_tip], wt.get_parent_ids())
182
 
        self.failUnlessExists('checkout/file')
183
 
        self.failUnlessExists('checkout/file_b')
184
 
        self.failUnlessExists('checkout/file_c')
 
182
        self.assertPathExists('checkout/file')
 
183
        self.assertPathExists('checkout/file_b')
 
184
        self.assertPathExists('checkout/file_c')
185
185
        self.assertTrue(wt.has_filename('file_c'))
186
186
 
187
187
    def test_update_with_merges(self):
299
299
2>All changes applied successfully.
300
300
2>Updated to revision 1 of .../master
301
301
''')
302
 
        self.failUnlessExists('./file1')
303
 
        self.failIfExists('./file2')
 
302
        self.assertPathExists('./file1')
 
303
        self.assertPathDoesNotExist('./file2')
304
304
        self.assertEquals(['m1'], master.get_parent_ids())
305
305
 
306
306
    def test_update_dash_r_outside_history(self):
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"""