comparison tests/comprehensive/test_rebuildmeta.py @ 1133:ff4e102932ed

tests: use util.load instead of bare pickle
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 17 Feb 2014 11:25:36 -0600
parents 6e1dbf6cbc92
children 34173bbd3b8e
comparison
equal deleted inserted replaced
1132:0a55d7c9a071 1133:ff4e102932ed
1 import os 1 import os
2 import pickle
3 import unittest 2 import unittest
4 import sys 3 import sys
5 4
6 # wrapped in a try/except because of weirdness in how 5 # wrapped in a try/except because of weirdness in how
7 # run.py works as compared to nose. 6 # run.py works as compared to nose.
17 from mercurial import ui 16 from mercurial import ui
18 17
19 from hgsubversion import compathacks 18 from hgsubversion import compathacks
20 from hgsubversion import svncommands 19 from hgsubversion import svncommands
21 from hgsubversion import svnmeta 20 from hgsubversion import svnmeta
21 from hgsubversion import util
22 22
23 # These test repositories have harmless skew in rebuildmeta for the 23 # These test repositories have harmless skew in rebuildmeta for the
24 # last-pulled-rev because the last rev in svn causes absolutely no 24 # last-pulled-rev because the last rev in svn causes absolutely no
25 # changes in hg. 25 # changes in hg.
26 expect_youngest_skew = [('file_mixed_with_branches.svndump', False, False), 26 expect_youngest_skew = [('file_mixed_with_branches.svndump', False, False),
123 try: 123 try:
124 self.assertEqual(src.branchmap(), dest.branchmap()) 124 self.assertEqual(src.branchmap(), dest.branchmap())
125 except AttributeError: 125 except AttributeError:
126 # hg 2.8 and earlier 126 # hg 2.8 and earlier
127 self.assertEqual(src.branchtags(), dest.branchtags()) 127 self.assertEqual(src.branchtags(), dest.branchtags())
128 srcbi = pickle.load(open(os.path.join(src.path, 'svn', 'branch_info'))) 128 srcbi = util.load(os.path.join(src.path, 'svn', 'branch_info'))
129 destbi = pickle.load(open(os.path.join(dest.path, 'svn', 'branch_info'))) 129 destbi = util.load(os.path.join(dest.path, 'svn', 'branch_info'))
130 self.assertEqual(sorted(srcbi.keys()), sorted(destbi.keys())) 130 self.assertEqual(sorted(srcbi.keys()), sorted(destbi.keys()))
131 revkeys = svnmeta.SVNMeta(dest).revmap.keys() 131 revkeys = svnmeta.SVNMeta(dest).revmap.keys()
132 for branch in destbi: 132 for branch in destbi:
133 srcinfo = srcbi[branch] 133 srcinfo = srcbi[branch]
134 destinfo = destbi[branch] 134 destinfo = destbi[branch]