~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
        tree_a.commit('commit b')
237
237
        # reset parent
238
238
        parent = branch_b.get_parent()
 
239
        branch_b = branch.Branch.open('branch_b')
239
240
        branch_b.set_parent(None)
240
241
        self.assertEqual(None, branch_b.get_parent())
241
242
        # test pull for failure without parent set
252
253
                ('','bzr: ERROR: These branches have diverged.'
253
254
                    ' Use the missing command to see how.\n'
254
255
                    'Use the merge command to reconcile them.\n'))
255
 
        self.assertEqual(branch_b.get_parent(), parent)
 
256
        tree_b = tree_b.bzrdir.open_workingtree()
 
257
        branch_b = tree_b.branch
 
258
        self.assertEqual(parent, branch_b.get_parent())
256
259
        # test implicit --remember after resolving previous failure
257
260
        uncommit.uncommit(branch=branch_b, tree=tree_b)
258
261
        t.delete('branch_b/d')
259
262
        self.run_bzr('pull', working_dir='branch_b')
 
263
        # Refresh the branch object as 'pull' modified it
 
264
        branch_b = branch_b.bzrdir.open_branch()
260
265
        self.assertEqual(branch_b.get_parent(), parent)
261
266
        # test explicit --remember
262
267
        self.run_bzr('pull ../branch_c --remember', working_dir='branch_b')
263
 
        self.assertEqual(branch_b.get_parent(),
264
 
                          branch_c.bzrdir.root_transport.base)
 
268
        # Refresh the branch object as 'pull' modified it
 
269
        branch_b = branch_b.bzrdir.open_branch()
 
270
        self.assertEqual(branch_c.bzrdir.root_transport.base,
 
271
                         branch_b.get_parent())
265
272
 
266
273
    def test_pull_bundle(self):
267
274
        from bzrlib.testament import Testament
360
367
    def test_pull_verbose_uses_default_log(self):
361
368
        tree = self.example_branch('source')
362
369
        target = self.make_branch_and_tree('target')
363
 
        target_config = target.branch.get_config_stack()
364
 
        target_config.set('log_format', 'short')
 
370
        target.branch.get_config_stack().set('log_format', 'short')
365
371
        out = self.run_bzr('pull -v source -d target')[0]
366
372
        self.assertContainsRe(out, r'\n {4}1 .*\n {6}setup\n')
367
373
        self.assertNotContainsRe(