comparison tests/test_rebuildmeta.py @ 405:a98b8d424221

editor: simplify HgChangeReceiver constructor signature
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 10 Jun 2009 13:32:10 +0200
parents 987bd7444f60
children 343da842dbe6
comparison
equal deleted inserted replaced
404:28e4b47b2179 405:a98b8d424221
36 open(dtf).read()) 36 open(dtf).read())
37 self.assertEqual(src.branchtags(), dest.branchtags()) 37 self.assertEqual(src.branchtags(), dest.branchtags())
38 srcbi = pickle.load(open(os.path.join(src.path, 'svn', 'branch_info'))) 38 srcbi = pickle.load(open(os.path.join(src.path, 'svn', 'branch_info')))
39 destbi = pickle.load(open(os.path.join(dest.path, 'svn', 'branch_info'))) 39 destbi = pickle.load(open(os.path.join(dest.path, 'svn', 'branch_info')))
40 self.assertEqual(sorted(srcbi.keys()), sorted(destbi.keys())) 40 self.assertEqual(sorted(srcbi.keys()), sorted(destbi.keys()))
41 revkeys = hg_delta_editor.HgChangeReceiver(dest).revmap.keys()
41 for branch in destbi: 42 for branch in destbi:
42 srcinfo = srcbi[branch] 43 srcinfo = srcbi[branch]
43 destinfo = destbi[branch] 44 destinfo = destbi[branch]
44 hge = hg_delta_editor.HgChangeReceiver(path=os.path.dirname(dest.path),
45 repo=dest,
46 ui_=u)
47 if destinfo[:2] == (None, 0): 45 if destinfo[:2] == (None, 0):
48 self.assert_(srcinfo[2] <= destinfo[2]) 46 self.assert_(srcinfo[2] <= destinfo[2])
49 self.assertEqual(srcinfo[0], destinfo[0]) 47 self.assertEqual(srcinfo[0], destinfo[0])
50 else: 48 else:
51 pr = sorted(filter(lambda x: x[1] == srcinfo[0] and x[0] <= srcinfo[1], 49 pr = sorted(filter(lambda x: x[1] == srcinfo[0] and x[0] <= srcinfo[1],
52 hge.revmap.keys()), reverse=True)[0][0] 50 revkeys), reverse=True)[0][0]
53 self.assertEqual(pr, destinfo[1]) 51 self.assertEqual(pr, destinfo[1])
54 self.assertEqual(srcinfo[2], destinfo[2]) 52 self.assertEqual(srcinfo[2], destinfo[2])
55 53
56 54
57 def buildmethod(case, name, stupid): 55 def buildmethod(case, name, stupid):