~lifeless/bzr/index.range_map

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2008-06-19 01:17:19 UTC
  • mfrom: (3218.1.277 +trunk)
  • Revision ID: robertc@robertcollins.net-20080619011719-1c4g4uxzzhdls2wf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
                'push ../dir',
249
249
                working_dir='tree')
250
250
 
 
251
    def test_push_with_revisionspec(self):
 
252
        """We should be able to push a revision older than the tip."""
 
253
        tree_from = self.make_branch_and_tree('from')
 
254
        tree_from.commit("One.", rev_id="from-1")
 
255
        tree_from.commit("Two.", rev_id="from-2")
 
256
 
 
257
        self.run_bzr('push -r1 ../to', working_dir='from')
 
258
 
 
259
        tree_to = WorkingTree.open('to')
 
260
        repo_to = tree_to.branch.repository
 
261
        self.assertTrue(repo_to.has_revision('from-1'))
 
262
        self.assertFalse(repo_to.has_revision('from-2'))
 
263
        self.assertEqual(tree_to.branch.last_revision_info()[1], 'from-1')
 
264
 
 
265
        self.run_bzr_error(
 
266
            "bzr: ERROR: bzr push --revision takes one value.\n",
 
267
            'push -r0..2 ../to', working_dir='from')
 
268
 
251
269
 
252
270
class RedirectingMemoryTransport(MemoryTransport):
253
271