Mercurial > hgsubversion
comparison tests/test_push_command.py @ 1040:ada2400241c4
fixes for running under Mercurial 2.0
| author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
|---|---|
| date | Mon, 05 Aug 2013 20:27:31 +0200 |
| parents | e775ffbcb359 |
| children | d741f536f23a |
comparison
equal
deleted
inserted
replaced
| 1039:3df6ed4e7561 | 1040:ada2400241c4 |
|---|---|
| 14 from mercurial import commands | 14 from mercurial import commands |
| 15 from mercurial import hg | 15 from mercurial import hg |
| 16 from mercurial import node | 16 from mercurial import node |
| 17 from mercurial import revlog | 17 from mercurial import revlog |
| 18 from mercurial import util as hgutil | 18 from mercurial import util as hgutil |
| 19 | |
| 20 from hgsubversion import util | |
| 19 | 21 |
| 20 import time | 22 import time |
| 21 | 23 |
| 22 | 24 |
| 23 class PushTests(test_util.TestBase): | 25 class PushTests(test_util.TestBase): |
| 592 self.assertEqual(len(self.repo), oldlen + 2) | 594 self.assertEqual(len(self.repo), oldlen + 2) |
| 593 | 595 |
| 594 # verify that the first commit is pushed, and the second is not | 596 # verify that the first commit is pushed, and the second is not |
| 595 commit2 = self.repo['tip'] | 597 commit2 = self.repo['tip'] |
| 596 self.assertEqual(commit2.files(), ['delta', ]) | 598 self.assertEqual(commit2.files(), ['delta', ]) |
| 597 self.assertTrue(commit2.mutable()) | 599 self.assertEqual(util.getsvnrev(commit2), None) |
| 598 commit1 = commit2.parents()[0] | 600 commit1 = commit2.parents()[0] |
| 599 self.assertEqual(commit1.files(), ['gamma', ]) | 601 self.assertEqual(commit1.files(), ['gamma', ]) |
| 600 self.assertFalse(commit1.mutable()) | 602 prefix = 'svn:' + self.repo.svnmeta().uuid |
| 603 self.assertEqual(util.getsvnrev(commit1), | |
| 604 prefix + '/branches/the_branch@5') | |
| 601 | 605 |
| 602 def test_push_two_that_modify_same_file(self): | 606 def test_push_two_that_modify_same_file(self): |
| 603 ''' | 607 ''' |
| 604 Push performs a rebase if two commits touch the same file. | 608 Push performs a rebase if two commits touch the same file. |
| 605 This test verifies that code path works. | 609 This test verifies that code path works. |
| 621 self.assertEqual(len(self.repo), oldlen + 2) | 625 self.assertEqual(len(self.repo), oldlen + 2) |
| 622 | 626 |
| 623 # verify that both commits are pushed | 627 # verify that both commits are pushed |
| 624 commit1 = self.repo['tip'] | 628 commit1 = self.repo['tip'] |
| 625 self.assertEqual(commit1.files(), ['delta', 'gamma']) | 629 self.assertEqual(commit1.files(), ['delta', 'gamma']) |
| 626 self.assertFalse(commit1.mutable()) | 630 |
| 631 prefix = 'svn:' + self.repo.svnmeta().uuid | |
| 632 self.assertEqual(util.getsvnrev(commit1), | |
| 633 prefix + '/branches/the_branch@6') | |
| 627 commit2 = commit1.parents()[0] | 634 commit2 = commit1.parents()[0] |
| 628 self.assertEqual(commit2.files(), ['gamma']) | 635 self.assertEqual(commit2.files(), ['gamma']) |
| 629 self.assertFalse(commit2.mutable()) | 636 self.assertEqual(util.getsvnrev(commit2), |
| 637 prefix + '/branches/the_branch@5') | |
| 630 | 638 |
| 631 def test_push_in_subdir(self, commit=True): | 639 def test_push_in_subdir(self, commit=True): |
| 632 repo = self.repo | 640 repo = self.repo |
| 633 old_tip = repo['tip'].node() | 641 old_tip = repo['tip'].node() |
| 634 def file_callback(repo, memctx, path): | 642 def file_callback(repo, memctx, path): |
