Mercurial > hgsubversion
annotate tests/test_push_eol.py @ 131:4d42dbbb5127
hg_delta_editor: fix parent revision detection on branch copy
Project items copyfrom revisions are irrelevant to parent revision detection,
only the project one or those of its ancestors matter. Items copyfrom is
useful when retrieving items content.
Former code resulted in incorrect converted graph for pyglet repository,
especially on the following revision:
------------------------------------------------------------------------
r274 | r1chardj0n3s | 2006-12-21 02:02:14 +0100 (Jeu, 21 Dec 2006) | 2 lines
Changed paths:
A /branches/richard-glx-version (from /trunk:269)
M /branches/richard-glx-version/pyglet/window/xlib/__init__.py
R /branches/richard-glx-version/tests/test.py (from /trunk/tests/test.py:270)
R /branches/richard-glx-version/tools/info.py (from /trunk/tools/info.py:272)
R /branches/richard-glx-version/website/get_involved.php (from /trunk/website/get_involved.php:273)
Branching to horribly mangle GLX
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 10 Dec 2008 11:03:22 -0600 |
parents | 9b5e528f67f8 |
children | c2d606a1dc6f |
rev | line source |
---|---|
96
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 import unittest |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 import test_util |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 class TestPushEol(test_util.TestBase): |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 def setUp(self): |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 test_util.TestBase.setUp(self) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 test_util.load_fixture_and_fetch('emptyrepo.svndump', |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 self.repo_path, |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 self.wc_path) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 def _test_push_dirs(self, stupid): |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 changes = [ |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 # Root files with LF, CRLF and mixed EOL |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 ('lf', 'lf', 'a\nb\n\nc'), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc'), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd'), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 ] |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 self.commitchanges(changes) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 self.pushrevisions(stupid) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 self.assertchanges(changes, self.repo['tip']) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 changes = [ |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 # Update all files once, with same EOL |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 ('lf', 'lf', 'a\nb\n\nc\na\nb\n\nc'), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc\r\na\r\nb\r\n\r\nc'), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd\r\na\r\nb\n\r\nc\nd'), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 ] |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 self.commitchanges(changes) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 self.pushrevisions(stupid) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 self.assertchanges(changes, self.repo['tip']) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 def test_push_dirs(self): |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 self._test_push_dirs(False) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 def test_push_dirs_stupid(self): |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 self._test_push_dirs(True) |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 def suite(): |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 all = [unittest.TestLoader().loadTestsFromTestCase(TestPushEol), |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 ] |
9b5e528f67f8
Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 return unittest.TestSuite(all) |