~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-04-16 11:35:53 UTC
  • mfrom: (6159.2.8 overwrite-tags)
  • Revision ID: pqm@pqm.ubuntu.com-20120416113553-1vnossk7c384rp4q
(jelmer) Add --overwrite-tags option to push and pull. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
533
533
        self.assertEqual(out,
534
534
            ('1 tag(s) updated.\n', ''))
535
535
 
 
536
    def test_overwrite_tags(self):
 
537
        """--overwrite-tags only overwrites tags, not revisions."""
 
538
        from_tree = self.make_branch_and_tree('from')
 
539
        from_tree.branch.tags.set_tag("mytag", "somerevid")
 
540
        to_tree = self.make_branch_and_tree('to')
 
541
        to_tree.branch.tags.set_tag("mytag", "anotherrevid")
 
542
        revid1 = to_tree.commit('my commit')
 
543
        out = self.run_bzr(['pull', '-d', 'to', 'from'], retcode=1)
 
544
        self.assertEquals(out,
 
545
            ('No revisions to pull.\nConflicting tags:\n    mytag\n', ''))
 
546
        out = self.run_bzr(['pull', '-d', 'to', '--overwrite-tags', 'from'])
 
547
        self.assertEquals(out, ('1 tag(s) updated.\n', ''))
 
548
 
 
549
        self.assertEquals(to_tree.branch.tags.lookup_tag('mytag'),
 
550
                          'somerevid')
 
551
        self.assertEquals(to_tree.branch.last_revision(), revid1)
 
552
 
536
553
    def test_pull_tag_overwrite(self):
537
554
        """pulling tags with --overwrite only reports changed tags."""
538
555
        # create a branch, see that --show-base fails