~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2011-02-07 04:14:29 UTC
  • mfrom: (5535.4.26 fetch-all-tags-309682)
  • mto: This revision was merged to the branch mainline in revision 5648.
  • Revision ID: andrew.bennetts@canonical.com-20110207041429-3kc1blj34rvvxod9
Merge fetch-all-tags-309682.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    builtins,
25
25
    bzrdir,
26
26
    check,
27
 
    debug,
28
27
    errors,
29
28
    memorytree,
30
29
    push,
31
 
    repository,
32
30
    revision,
33
31
    symbol_versioning,
34
32
    tests,
36
34
    )
37
35
from bzrlib.smart import (
38
36
    client,
39
 
    server,
40
 
    repository as _mod_smart_repo,
41
37
    )
42
38
from bzrlib.tests import (
43
39
    per_branch,
174
170
        self.assertEqual(tree.branch.last_revision(),
175
171
                         to_branch.last_revision())
176
172
 
 
173
    def test_push_overwrite_with_older_mainline_rev(self):
 
174
        """Pushing an older mainline revision with overwrite.
 
175
 
 
176
        This was <https://bugs.launchpad.net/bzr/+bug/386576>.
 
177
        """
 
178
        source = self.make_branch_and_tree('source')
 
179
        target = self.make_branch('target')
 
180
 
 
181
        source.commit('1st commit')
 
182
        source.commit('2nd commit', rev_id='rev-2')
 
183
        source.commit('3rd commit')
 
184
        source.branch.push(target)
 
185
        source.branch.push(target, stop_revision='rev-2', overwrite=True)
 
186
        self.assertEqual('rev-2', target.last_revision())
 
187
 
177
188
    def test_push_overwrite_of_non_tip_with_stop_revision(self):
178
189
        """Combining the stop_revision and overwrite options works.
179
190