~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2010-04-21 11:27:04 UTC
  • mto: This revision was merged to the branch mainline in revision 5189.
  • Revision ID: mbp@canonical.com-20100421112704-zijso22b6pdevrxy
Simplify various code to use user_url

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
        conf.set_user_option('dpush_strict', value)
154
154
 
155
155
    _default_command = ['dpush', '../to']
 
156
    _default_pushed_revid = False # Doesn't aplly for dpush
 
157
 
 
158
    def assertPushSucceeds(self, args, pushed_revid=None, with_warning=False):
 
159
        if with_warning:
 
160
            error_regexes = self._default_errors
 
161
        else:
 
162
            error_regexes = []
 
163
        self.run_bzr(self._default_command + args,
 
164
                     working_dir=self._default_wd, error_regexes=error_regexes)
 
165
        if pushed_revid is None:
 
166
            # dpush change the revids, so we need to get back to it
 
167
            branch_from = branch.Branch.open(self._default_wd)
 
168
            pushed_revid = branch_from.last_revision()
 
169
        branch_to = branch.Branch.open('to')
 
170
        repo_to = branch_to.repository
 
171
        self.assertTrue(repo_to.has_revision(pushed_revid))
 
172
        self.assertEqual(branch_to.last_revision(), pushed_revid)
 
173
 
156
174
 
157
175
 
158
176
class TestDpushStrictWithoutChanges(TestDpushStrictMixin,