Mercurial > hgsubversion
changeset 1417:4f1461428334 stable
test_hooks: cope with localrepo.parents() going away
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 23 May 2016 17:15:58 -0400 |
parents | fc80c25bc94b |
children | c161586a6b77 f9e8c7662f8d |
files | tests/test_hooks.py tests/test_pull.py tests/test_pull_fallback.py |
diffstat | 3 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -17,7 +17,7 @@ class TestHooks(test_util.TestBase): def test_updatemetahook(self): repo, repo_path = self._loadupdate('single_rev.svndump') - state = repo.parents() + state = repo[None].parents() self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) commands.pull(self.repo.ui, self.repo)
--- a/tests/test_pull.py +++ b/tests/test_pull.py @@ -20,37 +20,37 @@ class TestPull(test_util.TestBase): def test_nochanges(self): self._loadupdate('single_rev.svndump') - state = self.repo.parents() + state = self.repo[None].parents() commands.pull(self.repo.ui, self.repo) - self.assertEqual(state, self.repo.parents()) + self.assertEqual(state, self.repo[None].parents()) def test_onerevision_noupdate(self): repo, repo_path = self._loadupdate('single_rev.svndump') - state = repo.parents() + state = repo[None].parents() self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) commands.pull(self.repo.ui, repo) - self.assertEqual(state, repo.parents()) + self.assertEqual(state, repo[None].parents()) self.assertTrue('tip' not in repo['.'].tags()) def test_onerevision_doupdate(self): repo, repo_path = self._loadupdate('single_rev.svndump') - state = repo.parents() + state = repo[None].parents() self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) commands.pull(self.repo.ui, repo, update=True) - self.failIfEqual(state, repo.parents()) + self.failIfEqual(state, repo[None].parents()) self.assertTrue('tip' in repo['.'].tags()) def test_onerevision_divergent(self): repo, repo_path = self._loadupdate('single_rev.svndump') self.commitchanges((('alpha', 'alpha', 'Changed another way'),)) - state = repo.parents() + state = repo[None].parents() self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed one way'}) try: commands.pull(self.repo.ui, repo, update=True) except hgutil.Abort: # hg < 1.9 raised when crossing branches pass - self.assertEqual(state, repo.parents()) + self.assertEqual(state, repo[None].parents()) self.assertTrue('tip' not in repo['.'].tags()) self.assertEqual(len(repo.heads()), 2)
--- a/tests/test_pull_fallback.py +++ b/tests/test_pull_fallback.py @@ -37,14 +37,14 @@ class TestPullFallback(test_util.TestBas # Passing stupid=True doesn't seem to be working - force it repo.ui.setconfig('hgsubversion', 'stupid', "true") - state = repo.parents() + state = repo[None].parents() calls, replaced = _monkey_patch(to_patch) try: self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) commands.pull(self.repo.ui, repo, update=True) - self.failIfEqual(state, repo.parents()) + self.failIfEqual(state, repo[None].parents()) self.assertTrue('tip' in repo[None].tags()) self.assertEqual(expected_calls, calls)