annotate tests/test_fetch_truncated.py @ 241:4950b18cf949

Move fetch_command.fetch_revisions() to svncommands.pull().
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 08 Apr 2009 17:49:30 +0200
parents 3b60f223893a
children ffccf0080e54
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
88
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 import unittest
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 from mercurial import hg
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 from mercurial import ui
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5
241
4950b18cf949 Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 88
diff changeset
6 import svncommands
88
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 import test_util
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 class TestFetchTruncatedHistory(test_util.TestBase):
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 def test_truncated_history(self, stupid=False):
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 # Test repository does not follow the usual layout
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 test_util.load_svndump_fixture(self.repo_path, 'truncatedhistory.svndump')
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 svn_url = test_util.fileurl(self.repo_path + '/project2')
241
4950b18cf949 Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 88
diff changeset
14 svncommands.pull(ui.ui(), svn_url=svn_url,
4950b18cf949 Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 88
diff changeset
15 hg_repo_path=self.wc_path, stupid=stupid)
88
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 repo = hg.repository(ui.ui(), self.wc_path)
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 # We are converting /project2/trunk coming from:
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 #
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 # Changed paths:
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 # D /project1
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 # A /project2/trunk (from /project1:2)
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 #
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 # Here a full fetch should be performed since we are starting
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 # the conversion on an already filled branch.
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 tip = repo['tip']
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 files = tip.manifest().keys()
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 files.sort()
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 self.assertEqual(files, ['a', 'b'])
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 self.assertEqual(repo['tip']['a'].data(), 'a\n')
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 def test_truncated_history_stupid(self):
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 self.test_truncated_history(True)
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 def suite():
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchTruncatedHistory),
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 ]
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 return unittest.TestSuite(all)