~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-01-09 20:55:07 UTC
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120109205507-2i3en5r4w4ohdchj
Use idioms coherently and add comments to make their purpose clearer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        self.assertEquals(out,
118
118
                ('','bzr: ERROR: These branches have diverged.  '
119
119
                 'See "bzr help diverged-branches" for more information.\n'))
120
 
        branch_a = bzrdir.BzrDir.open('branch_a').open_branch()
 
120
        # Refresh the branch as 'push' modified it
 
121
        branch_a = branch_a.bzrdir.open_branch()
121
122
        self.assertEquals(osutils.abspath(branch_a.get_push_location()),
122
123
                          osutils.abspath(branch_b.bzrdir.root_transport.base))
123
124
 
125
126
        uncommit.uncommit(branch=branch_b, tree=tree_b)
126
127
        transport.delete('branch_b/c')
127
128
        out, err = self.run_bzr('push', working_dir='branch_a')
128
 
        branch_a = bzrdir.BzrDir.open('branch_a').open_branch()
 
129
        # Refresh the branch as 'push' modified it
 
130
        branch_a = branch_a.bzrdir.open_branch()
129
131
        path = branch_a.get_push_location()
130
132
        self.assertEqual(err,
131
133
                         'Using saved push location: %s\n'
136
138
                         branch_b.bzrdir.root_transport.base)
137
139
        # test explicit --remember
138
140
        self.run_bzr('push ../branch_c --remember', working_dir='branch_a')
139
 
        branch_a = bzrdir.BzrDir.open('branch_a').open_branch()
 
141
        # Refresh the branch as 'push' modified it
 
142
        branch_a = branch_a.bzrdir.open_branch()
140
143
        self.assertEquals(branch_a.get_push_location(),
141
144
                          branch_c.bzrdir.root_transport.base)
142
145
 
179
182
        t.add('file')
180
183
        t.commit('commit 1')
181
184
        self.run_bzr('push -d tree pushed-to')
182
 
        path = bzrdir.BzrDir.open('tree').open_branch().get_push_location()
 
185
        # Refresh the branch as 'push' modified it and get the push location
 
186
        push_loc = t.branch.bzrdir.open_branch().get_push_location()
183
187
        out, err = self.run_bzr('push', working_dir="tree")
184
188
        self.assertEqual('Using saved push location: %s\n'
185
189
                         'No new revisions or tags to push.\n' %
186
 
                         urlutils.local_path_from_url(path), err)
 
190
                         urlutils.local_path_from_url(push_loc), err)
187
191
        out, err = self.run_bzr('push -q', working_dir="tree")
188
192
        self.assertEqual('', out)
189
193
        self.assertEqual('', err)