Mercurial > hgsubversion
comparison tests/test_pull.py @ 1339:74e82a7da393 stable
tests: check '.' for tags instead of None
Commit 24cda1dd45ff in upstream Mercurial changed repo[None] to no longer return
tags for the working copy parent. So we need to change the tests to check
repo['.'] instead. This should be backwards compatible with older Mercurials.
author | Durham Goode <durham@fb.com> |
---|---|
date | Wed, 08 Jul 2015 22:00:57 -0700 |
parents | 61d4fb78370b |
children | 4f1461428334 |
comparison
equal
deleted
inserted
replaced
1337:0f1f88e71138 | 1339:74e82a7da393 |
---|---|
28 repo, repo_path = self._loadupdate('single_rev.svndump') | 28 repo, repo_path = self._loadupdate('single_rev.svndump') |
29 state = repo.parents() | 29 state = repo.parents() |
30 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) | 30 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) |
31 commands.pull(self.repo.ui, repo) | 31 commands.pull(self.repo.ui, repo) |
32 self.assertEqual(state, repo.parents()) | 32 self.assertEqual(state, repo.parents()) |
33 self.assertTrue('tip' not in repo[None].tags()) | 33 self.assertTrue('tip' not in repo['.'].tags()) |
34 | 34 |
35 def test_onerevision_doupdate(self): | 35 def test_onerevision_doupdate(self): |
36 repo, repo_path = self._loadupdate('single_rev.svndump') | 36 repo, repo_path = self._loadupdate('single_rev.svndump') |
37 state = repo.parents() | 37 state = repo.parents() |
38 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) | 38 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) |
39 commands.pull(self.repo.ui, repo, update=True) | 39 commands.pull(self.repo.ui, repo, update=True) |
40 self.failIfEqual(state, repo.parents()) | 40 self.failIfEqual(state, repo.parents()) |
41 self.assertTrue('tip' in repo[None].tags()) | 41 self.assertTrue('tip' in repo['.'].tags()) |
42 | 42 |
43 def test_onerevision_divergent(self): | 43 def test_onerevision_divergent(self): |
44 repo, repo_path = self._loadupdate('single_rev.svndump') | 44 repo, repo_path = self._loadupdate('single_rev.svndump') |
45 self.commitchanges((('alpha', 'alpha', 'Changed another way'),)) | 45 self.commitchanges((('alpha', 'alpha', 'Changed another way'),)) |
46 state = repo.parents() | 46 state = repo.parents() |
49 commands.pull(self.repo.ui, repo, update=True) | 49 commands.pull(self.repo.ui, repo, update=True) |
50 except hgutil.Abort: | 50 except hgutil.Abort: |
51 # hg < 1.9 raised when crossing branches | 51 # hg < 1.9 raised when crossing branches |
52 pass | 52 pass |
53 self.assertEqual(state, repo.parents()) | 53 self.assertEqual(state, repo.parents()) |
54 self.assertTrue('tip' not in repo[None].tags()) | 54 self.assertTrue('tip' not in repo['.'].tags()) |
55 self.assertEqual(len(repo.heads()), 2) | 55 self.assertEqual(len(repo.heads()), 2) |
56 | 56 |
57 def test_tag_repull_doesnt_happen(self): | 57 def test_tag_repull_doesnt_happen(self): |
58 repo = self._loadupdate('branchtagcollision.svndump')[0] | 58 repo = self._loadupdate('branchtagcollision.svndump')[0] |
59 oldheads = map(node.hex, repo.heads()) | 59 oldheads = map(node.hex, repo.heads()) |