comparison tests/test_utility_commands.py @ 1588:e2d38f6b8afe

tests: make output comaptible with hash changes in hg-4.8 46da52f4b820 in core mercurial added logic to try hard to reuse manifest if we can. In the tests of hgsubversion, there are lot of cases we create an empty commit with just branch name changed. In hg < 4.8, hgsubversion used to create a new manifest entry for that commit but after that patch, empty commit started using the manifest of the parent leading to hash change.
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 31 Oct 2018 17:04:57 +0300
parents d55c9d0ba350
children
comparison
equal deleted inserted replaced
1587:4889843a704e 1588:e2d38f6b8afe
182 {'branch': 'localbranch', }) 182 {'branch': 'localbranch', })
183 new = lr.commitctx(ctx) 183 new = lr.commitctx(ctx)
184 hg.update(self.repo, new) 184 hg.update(self.repo, new)
185 wrappers.parents(lambda x, y: None, u, self.repo, svn=True) 185 wrappers.parents(lambda x, y: None, u, self.repo, svn=True)
186 actual = u.popbuffer() 186 actual = u.popbuffer()
187 self.assertEqual(actual, '3:4e256962fc5d\n') 187 # two hashes becaure in hg > 4.8 we try hard to reuse the manifest
188 self.assertTrue(actual in ('3:4e256962fc5d\n', '3:13c5dc1514ad\n'))
188 189
189 hg.update(self.repo, revsymbol(self.repo, 'default')) 190 hg.update(self.repo, revsymbol(self.repo, 'default'))
190 191
191 # Make sure styles work 192 # Make sure styles work
192 u.pushbuffer() 193 u.pushbuffer()
230 hg.update(self.repo, new) 231 hg.update(self.repo, new)
231 u.pushbuffer() 232 u.pushbuffer()
232 commands.outgoing(u, self.repo, repourl(repo_path)) 233 commands.outgoing(u, self.repo, repourl(repo_path))
233 actual = u.popbuffer() 234 actual = u.popbuffer()
234 self.assertTrue(node.hex(revsymbol(self.repo, 'localbranch').node())[:8] in actual) 235 self.assertTrue(node.hex(revsymbol(self.repo, 'localbranch').node())[:8] in actual)
235 self.assertEqual(actual.strip(), '5:6de15430fa20') 236 # two hashes for compat with hg < 4.8
237 self.assertTrue(actual.strip() in ('5:6de15430fa20', '5:76670ad282fd'))
236 hg.update(self.repo, revsymbol(self.repo, 'default')) 238 hg.update(self.repo, revsymbol(self.repo, 'default'))
237 u.pushbuffer() 239 u.pushbuffer()
238 commands.outgoing(u, self.repo, repourl(repo_path)) 240 commands.outgoing(u, self.repo, repourl(repo_path))
239 actual = u.popbuffer() 241 actual = u.popbuffer()
240 self.assertEqual(actual, '') 242 self.assertEqual(actual, '')