~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-21 13:36:51 UTC
  • mfrom: (5243.2.1 readdir_cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100521133651-p62dndo2giy5ls21
(lifeless) Some cleanups to the readdir pyrex code for a little efficiency
 and to avoid compile warnings. (John A Meinel)

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.assertPathExists('branch/file')
 
93
        self.failUnlessExists('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.assertPathExists('checkout/file')
183
 
        self.assertPathExists('checkout/file_b')
184
 
        self.assertPathExists('checkout/file_c')
 
182
        self.failUnlessExists('checkout/file')
 
183
        self.failUnlessExists('checkout/file_b')
 
184
        self.failUnlessExists('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.assertPathExists('./file1')
303
 
        self.assertPathDoesNotExist('./file2')
 
302
        self.failUnlessExists('./file1')
 
303
        self.failIfExists('./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
 
 
400
362
    def test_update_checkout_prevent_double_merge(self):
401
363
        """"Launchpad bug 113809 in bzr "update performs two merges"
402
364
        https://launchpad.net/bugs/113809"""