~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/commands/test_push.py

  • Committer: John Arbash Meinel
  • Date: 2009-01-08 19:48:48 UTC
  • mto: (3932.2.4 1.11)
  • mto: This revision was merged to the branch mainline in revision 3933.
  • Revision ID: john@arbash-meinel.com-20090108194848-93vcyrrg1snzqqjd
Track down the other cause of us connecting multiple times.

The repository acquisition policy objects weren't re-using the connections that
they knew about. This has been fixed.

Now 'bzr push' connects a single time, rather than connecting 4 times when
creating a new stacked-on branch, or 2 times for an existing stacked-on
branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        cmd.outf = tests.StringIOWrapper()
33
33
        cmd.run(self.get_url('remote'), directory='branch')
34
34
        self.assertEquals(1, len(self.connections))
 
35
 
 
36
    def test_push_onto_stacked(self):
 
37
        self.make_branch_and_tree('base', format='1.9')
 
38
        self.make_branch_and_tree('source', format='1.9')
 
39
 
 
40
        self.start_logging_connections()
 
41
 
 
42
        cmd = cmd_push()
 
43
        cmd.outf = tests.StringIOWrapper()
 
44
        cmd.run(self.get_url('remote'), directory='source',
 
45
                stacked_on=self.get_url('base'))
 
46
        self.assertEqual(1, len(self.connections))