comparison tests/comprehensive/test_verify_and_startrev.py @ 899:7f90bb48c9de

svn verify: use a custom editor and get_revision() Previously, we would fetch each file in the revision/changeset individually. With this change, we fetch the entire revision in one request, and use a custom editor to verify its contents. This is quite a lot faster than the previous means when verifying over the internet. By an order of magnitude or two, in fact. As data is transfered in a single operation, verifying a revision from PyPy took 30 seconds rather than 30 minutes, and saturated my 10Mbps connection. Please note that the output ordering isn't stable between the two; output will appear in reverse order when using the fast verifier.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 14 Dec 2011 00:07:58 +0100
parents 6bc8046e3d0a
children f9014e28721b
comparison
equal deleted inserted replaced
898:6524260be543 899:7f90bb48c9de
40 repo, svnpath = self.load_and_fetch(name, subdir=subdir, stupid=stupid, 40 repo, svnpath = self.load_and_fetch(name, subdir=subdir, stupid=stupid,
41 layout=layout) 41 layout=layout)
42 assert len(self.repo) > 0 42 assert len(self.repo) > 0
43 for i in repo: 43 for i in repo:
44 ctx = repo[i] 44 ctx = repo[i]
45 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node()), 0) 45 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(),
46 stupid=True), 0)
47 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(),
48 stupid=False), 0)
46 49
47 # check a startrev clone 50 # check a startrev clone
48 if layout == 'single' and name not in _skipshallow: 51 if layout == 'single' and name not in _skipshallow:
49 self.wc_path += '_shallow' 52 self.wc_path += '_shallow'
50 shallowrepo = self.fetch(svnpath, subdir=subdir, stupid=stupid, 53 shallowrepo = self.fetch(svnpath, subdir=subdir, stupid=stupid,
57 fulltip = repo['tip'] 60 fulltip = repo['tip']
58 shallowtip = shallowrepo['tip'] 61 shallowtip = shallowrepo['tip']
59 62
60 repo.ui.pushbuffer() 63 repo.ui.pushbuffer()
61 self.assertEqual(0, verify.verify(repo.ui, shallowrepo, 64 self.assertEqual(0, verify.verify(repo.ui, shallowrepo,
62 rev=shallowtip.node())) 65 rev=shallowtip.node(),
66 stupid=True))
67 self.assertEqual(0, verify.verify(repo.ui, shallowrepo,
68 rev=shallowtip.node(),
69 stupid=False))
70
71 stupidui = ui.ui(repo.ui)
72 stupidui.config('hgsubversion', 'stupid', True)
73 self.assertEqual(verify.verify(stupidui, repo, rev=ctx.node(),
74 stupid=True), 0)
75 self.assertEqual(verify.verify(stupidui, repo, rev=ctx.node(),
76 stupid=False), 0)
63 77
64 # viewing diff's of lists of files is easier on the eyes 78 # viewing diff's of lists of files is easier on the eyes
65 self.assertMultiLineEqual('\n'.join(fulltip), '\n'.join(shallowtip), 79 self.assertMultiLineEqual('\n'.join(fulltip), '\n'.join(shallowtip),
66 repo.ui.popbuffer()) 80 repo.ui.popbuffer())
67 81