~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-07-02 18:21:51 UTC
  • mfrom: (6531 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6535.
  • Revision ID: jelmer@samba.org-20120702182151-zk9utamutjtjhipq
mergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
613
613
        self.assertEqual('', out)
614
614
        self.assertEqual('Created new branch.\n', err)
615
615
 
 
616
    def test_overwrite_tags(self):
 
617
        """--overwrite-tags only overwrites tags, not revisions."""
 
618
        from_tree = self.make_branch_and_tree('from')
 
619
        from_tree.branch.tags.set_tag("mytag", "somerevid")
 
620
        to_tree = self.make_branch_and_tree('to')
 
621
        to_tree.branch.tags.set_tag("mytag", "anotherrevid")
 
622
        revid1 = to_tree.commit('my commit')
 
623
        out = self.run_bzr(['push', '-d', 'from', 'to'])
 
624
        self.assertEquals(out,
 
625
            ('Conflicting tags:\n    mytag\n', 'No new revisions to push.\n'))
 
626
        out = self.run_bzr(['push', '-d', 'from', '--overwrite-tags', 'to'])
 
627
        self.assertEquals(out, ('', '1 tag updated.\n'))
 
628
        self.assertEquals(to_tree.branch.tags.lookup_tag('mytag'),
 
629
                          'somerevid')
 
630
        self.assertEquals(to_tree.branch.last_revision(), revid1)
 
631
 
616
632
 
617
633
class RedirectingMemoryTransport(memory.MemoryTransport):
618
634