comparison tests/test_fetch_truncated.py @ 88:3b60f223893a

fetch_command: handle nullid parent in stupid non-diffy mode
author Patrick Mezard <pmezard@gmail.com>
date Fri, 14 Nov 2008 16:18:24 -0600
parents
children 4950b18cf949
comparison
equal deleted inserted replaced
87:b033d74be76b 88:3b60f223893a
1 import unittest
2
3 from mercurial import hg
4 from mercurial import ui
5
6 import fetch_command
7 import test_util
8
9 class TestFetchTruncatedHistory(test_util.TestBase):
10 def test_truncated_history(self, stupid=False):
11 # Test repository does not follow the usual layout
12 test_util.load_svndump_fixture(self.repo_path, 'truncatedhistory.svndump')
13 svn_url = test_util.fileurl(self.repo_path + '/project2')
14 fetch_command.fetch_revisions(ui.ui(),
15 svn_url=svn_url,
16 hg_repo_path=self.wc_path,
17 stupid=stupid)
18 repo = hg.repository(ui.ui(), self.wc_path)
19
20 # We are converting /project2/trunk coming from:
21 #
22 # Changed paths:
23 # D /project1
24 # A /project2/trunk (from /project1:2)
25 #
26 # Here a full fetch should be performed since we are starting
27 # the conversion on an already filled branch.
28 tip = repo['tip']
29 files = tip.manifest().keys()
30 files.sort()
31 self.assertEqual(files, ['a', 'b'])
32 self.assertEqual(repo['tip']['a'].data(), 'a\n')
33
34 def test_truncated_history_stupid(self):
35 self.test_truncated_history(True)
36
37 def suite():
38 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchTruncatedHistory),
39 ]
40 return unittest.TestSuite(all)