comparison tests/test_startrev.py @ 657:9cf547fc36e8

pull: fix shallow clone when lastest change isn't HEAD. Previously, using `hg clone --startrev HEAD` when the actual HEAD revision didn't touch the prefix, would cause it to report that no changes were found. Using last_changed_rev instead of HEAD fixes this. In order to better test this scenario, we now clone the trunk subdirectory of all the fixtures.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 11 Aug 2010 19:57:34 +0200
parents ab454ee515d4
children d101b39f6c51
comparison
equal deleted inserted replaced
656:1add57910c82 657:9cf547fc36e8
19 19
20 for f in fulltip: 20 for f in fulltip:
21 self.assertMultiLineEqual(fulltip[f].data(), headtip[f].data()) 21 self.assertMultiLineEqual(fulltip[f].data(), headtip[f].data())
22 22
23 def buildmethod(case, name, subdir, stupid): 23 def buildmethod(case, name, subdir, stupid):
24 m = lambda self: self._do_case(case, subdir, stupid) 24 m = lambda self: self._do_case(case, subdir.strip('/'), stupid)
25 m.__name__ = name 25 m.__name__ = name
26 m.__doc__ = ('Test clone with startrev on %s%s with %s replay.' % 26 m.__doc__ = ('Test clone with startrev on %s%s with %s replay.' %
27 (case, subdir, (stupid and 'stupid') or 'real')) 27 (case, subdir, (stupid and 'stupid') or 'real'))
28 return m 28 return m
29 29
30 30
31 attrs = {'_do_case': _do_case, 31 attrs = {'_do_case': _do_case,
32 } 32 }
33 for case in [f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')]: 33 for case in [f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')]:
34 # this fixture results in an empty repository, don't use it 34 subdir = test_util.subdir.get(case, '') + '/trunk'
35 if case == 'project_root_not_repo_root.svndump':
36 continue
37 subdir = test_util.subdir.get(case, '')
38 35
39 bname = 'test_' + case[:-len('.svndump')] 36 bname = 'test_' + case[:-len('.svndump')]
40 attrs[bname] = buildmethod(case, bname, subdir, False) 37 attrs[bname] = buildmethod(case, bname, subdir, False)
41 name = bname + '_stupid' 38 name = bname + '_stupid'
42 attrs[name] = buildmethod(case, name, subdir, True) 39 attrs[name] = buildmethod(case, name, subdir, True)