~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-13 09:19:53 UTC
  • mfrom: (5148.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100413091953-ow6ds0g52xn734v5
Warn when the working tree is dirty instead of failing for dpush,
        push and send

Show diffs side-by-side

added added

removed removed

Lines of Context:
664
664
    _default_pushed_revid = 'modified'
665
665
 
666
666
    def assertPushFails(self, args):
667
 
        self.run_bzr_error(self._default_errors, self._default_command + args,
668
 
                           working_dir=self._default_wd, retcode=3)
 
667
        ret = self.run_bzr_error(self._default_errors,
 
668
                                 self._default_command + args,
 
669
                                 working_dir=self._default_wd, retcode=3)
669
670
 
670
 
    def assertPushSucceeds(self, args, pushed_revid=None):
 
671
    def assertPushSucceeds(self, args, pushed_revid=None, with_warning=False):
 
672
        if with_warning:
 
673
            error_regexes = self._default_errors
 
674
        else:
 
675
            error_regexes = []
671
676
        self.run_bzr(self._default_command + args,
672
 
                     working_dir=self._default_wd)
 
677
                     working_dir=self._default_wd, error_regexes=error_regexes)
673
678
        if pushed_revid is None:
674
679
            pushed_revid = self._default_pushed_revid
675
680
        tree_to = workingtree.WorkingTree.open('to')
745
750
        self._default_pushed_revid = 'modified-in-local'
746
751
 
747
752
    def test_push_default(self):
748
 
        self.assertPushFails([])
 
753
        self.assertPushSucceeds([], with_warning=True)
749
754
 
750
755
    def test_push_with_revision(self):
751
756
        self.assertPushSucceeds(['-r', 'revid:added'], pushed_revid='added')
762
767
 
763
768
    def test_push_bogus_config_var_ignored(self):
764
769
        self.set_config_push_strict("I don't want you to be strict")
765
 
        self.assertPushFails([])
 
770
        self.assertPushSucceeds([], with_warning=True)
766
771
 
767
772
    def test_push_no_strict_command_line_override_config(self):
768
773
        self.set_config_push_strict('yES')