Mercurial > hgsubversion
annotate tests/test_fetch_command.py @ 119:ea65fe2b0856
hg_delta_editor: fix update of stray files in branches/
Ensure that self.current_file is a non-empty path in a branch.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 29 Nov 2008 11:25:01 -0600 |
parents | e58c2f1de059 |
children | c35f59aa200e |
rev | line source |
---|---|
14
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
1 import unittest |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
2 |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
3 from mercurial import hg |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
4 from mercurial import ui |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
5 from mercurial import node |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
6 |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
15
diff
changeset
|
7 import test_util |
14
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
8 |
18
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
9 |
91
7d10165cf3d9
tests: Mock the mercurial.ui.ui class like we really should to capture output.
Augie Fackler <durin42@gmail.com>
parents:
78
diff
changeset
|
10 class TestBasicRepoLayout(test_util.TestBase): |
112
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
11 def _load_fixture_and_fetch(self, fixture_name, subdir=''): |
25
99f8e4b535e9
svn 1.4 and 1.5 have different ideas of diff output for prop changes.
Augie Fackler <durin42@gmail.com>
parents:
22
diff
changeset
|
12 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, |
112
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
13 self.wc_path, subdir=subdir) |
14
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
14 |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
15 def test_fresh_fetch_single_rev(self): |
22
95d0109e495e
Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents:
21
diff
changeset
|
16 repo = self._load_fixture_and_fetch('single_rev.svndump') |
21
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
17 self.assertEqual(node.hex(repo['tip'].node()), |
14
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
18 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
19 self.assertEqual(repo['tip'], repo[0]) |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
20 |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
21 def test_fresh_fetch_two_revs(self): |
22
95d0109e495e
Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents:
21
diff
changeset
|
22 repo = self._load_fixture_and_fetch('two_revs.svndump') |
14
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
23 # TODO there must be a better way than repo[0] for this check |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
24 self.assertEqual(node.hex(repo[0].node()), |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
25 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
26 self.assertEqual(node.hex(repo['tip'].node()), |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
27 'bf3767835b3b32ecc775a298c2fa27134dd91c11') |
d78dbf88c13d
Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
28 self.assertEqual(repo['tip'], repo[1]) |
15
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
29 |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
30 def test_branches(self): |
22
95d0109e495e
Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents:
21
diff
changeset
|
31 repo = self._load_fixture_and_fetch('simple_branch.svndump') |
15
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
32 # TODO there must be a better way than repo[0] for this check |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
33 self.assertEqual(node.hex(repo[0].node()), |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
34 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
35 self.assertEqual(node.hex(repo['tip'].node()), |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
36 '9dfb0a19494f45c36e22f3c6d1b21d80638a7f6e') |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
37 self.assertEqual(len(repo['tip'].parents()), 1) |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
38 self.assertEqual(repo['tip'].parents()[0], repo['default']) |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
39 self.assertEqual(len(repo.heads()), 1) |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
40 |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
41 def test_two_branches_with_heads(self): |
22
95d0109e495e
Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents:
21
diff
changeset
|
42 repo = self._load_fixture_and_fetch('two_heads.svndump') |
15
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
43 # TODO there must be a better way than repo[0] for this check |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
44 self.assertEqual(node.hex(repo[0].node()), |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
45 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
46 self.assertEqual(node.hex(repo['tip'].node()), |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
47 'a595c77cfcaa3d1ba9e04b2c55c68bc6bf2b0fbf') |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
48 self.assertEqual(node.hex(repo['the_branch'].node()), |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
49 '8ccaba5f0eae124487e413abd904a013f7f6fdeb') |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
50 self.assertEqual(node.hex(repo['the_branch'].parents()[0].node()), |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
51 '9dfb0a19494f45c36e22f3c6d1b21d80638a7f6e') |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
52 self.assertEqual(len(repo['tip'].parents()), 1) |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
53 self.assertEqual(repo['tip'], repo['default']) |
db32dee803a8
Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
54 self.assertEqual(len(repo.heads()), 2) |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
15
diff
changeset
|
55 |
21
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
56 def test_many_special_cases_replay(self): |
22
95d0109e495e
Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents:
21
diff
changeset
|
57 repo = self._load_fixture_and_fetch('many_special_cases.svndump') |
21
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
58 # TODO there must be a better way than repo[0] for this check |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
59 self._many_special_cases_checks(repo) |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
60 |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
61 |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
62 def test_many_special_cases_diff(self): |
22
95d0109e495e
Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents:
21
diff
changeset
|
63 repo = self._load_fixture_and_fetch('many_special_cases.svndump') |
21
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
64 # TODO there must be a better way than repo[0] for this check |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
65 self._many_special_cases_checks(repo) |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
66 |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
67 def _many_special_cases_checks(self, repo): |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
68 self.assertEqual(node.hex(repo[0].node()), |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
69 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
70 self.assertEqual(node.hex(repo['tip'].node()), |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
71 '179fb7d9bc77eef78288661f0430e0c1dff56b6f') |
21
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
72 self.assertEqual(node.hex(repo['the_branch'].node()), |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
73 '8ccaba5f0eae124487e413abd904a013f7f6fdeb') |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
74 self.assertEqual(node.hex(repo['the_branch'].parents()[0].node()), |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
75 '9dfb0a19494f45c36e22f3c6d1b21d80638a7f6e') |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
76 self.assertEqual(len(repo['tip'].parents()), 1) |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
77 self.assertEqual(repo['tip'], repo['default']) |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
78 self.assertEqual(len(repo.heads()), 2) |
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
79 |
40
9952f03ddfbe
Add a test that proves files in the branches directory don't cause breakage.
Augie Fackler <durin42@gmail.com>
parents:
25
diff
changeset
|
80 def test_file_mixed_with_branches(self): |
9952f03ddfbe
Add a test that proves files in the branches directory don't cause breakage.
Augie Fackler <durin42@gmail.com>
parents:
25
diff
changeset
|
81 repo = self._load_fixture_and_fetch('file_mixed_with_branches.svndump') |
9952f03ddfbe
Add a test that proves files in the branches directory don't cause breakage.
Augie Fackler <durin42@gmail.com>
parents:
25
diff
changeset
|
82 self.assertEqual(node.hex(repo['tip'].node()), |
9952f03ddfbe
Add a test that proves files in the branches directory don't cause breakage.
Augie Fackler <durin42@gmail.com>
parents:
25
diff
changeset
|
83 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
9952f03ddfbe
Add a test that proves files in the branches directory don't cause breakage.
Augie Fackler <durin42@gmail.com>
parents:
25
diff
changeset
|
84 assert 'README' not in repo |
9952f03ddfbe
Add a test that proves files in the branches directory don't cause breakage.
Augie Fackler <durin42@gmail.com>
parents:
25
diff
changeset
|
85 |
41
496c0354019c
Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents:
40
diff
changeset
|
86 def test_files_copied_from_outside_btt(self): |
496c0354019c
Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents:
40
diff
changeset
|
87 repo = self._load_fixture_and_fetch( |
496c0354019c
Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents:
40
diff
changeset
|
88 'test_files_copied_from_outside_btt.svndump') |
496c0354019c
Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents:
40
diff
changeset
|
89 self.assertEqual(node.hex(repo['tip'].node()), |
496c0354019c
Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents:
40
diff
changeset
|
90 'c4e669a763a70f751c71d4534a34a65f398d71d4') |
496c0354019c
Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents:
40
diff
changeset
|
91 self.assertEqual(len(repo.changelog), 2) |
21
8626f3d2e50b
Add a small stack of tests that exercise some of the interesting special cases.
Augie Fackler <durin42@gmail.com>
parents:
18
diff
changeset
|
92 |
43
af7ac6c03452
Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents:
41
diff
changeset
|
93 def test_file_renamed_in_from_outside_btt(self): |
af7ac6c03452
Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents:
41
diff
changeset
|
94 repo = self._load_fixture_and_fetch( |
af7ac6c03452
Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents:
41
diff
changeset
|
95 'file_renamed_in_from_outside_btt.svndump') |
af7ac6c03452
Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents:
41
diff
changeset
|
96 self.assert_('LICENSE.file' in repo['tip']) |
af7ac6c03452
Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents:
41
diff
changeset
|
97 |
112
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
98 def test_renamed_dir_in_from_outside_btt_not_repo_root(self): |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
99 repo = self._load_fixture_and_fetch( |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
100 'fetch_missing_files_subdir.svndump', subdir='foo') |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
101 self.assertEqual(node.hex(repo['tip'].node()), |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
102 '2fae2544a5858d0bc6c04976683b3dcc0416d6e3') |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
103 self.assert_('bar/alpha' in repo['tip']) |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
104 self.assert_('foo' in repo['tip']) |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
105 self.assert_('bar/alpha' not in repo['tip'].parents()[0]) |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
106 self.assert_('foo' in repo['tip'].parents()[0]) |
e58c2f1de059
Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents:
111
diff
changeset
|
107 |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
108 def test_oldest_not_trunk_and_tag_vendor_branch(self): |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
109 repo = self._load_fixture_and_fetch( |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
110 'tagged_vendor_and_oldest_not_trunk.svndump') |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
111 self.assertEqual(node.hex(repo['oldest'].node()), |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
112 'd73002bcdeffe389a8df81ee43303d36e79e8ca4') |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
113 self.assertEqual(repo['tip'].parents()[0].parents()[0], |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
114 repo['oldest']) |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
115 self.assertEqual(node.hex(repo['tip'].node()), |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
116 '9cf09e6ff7fa938188c3bcc9dd87abd7842c080c') |
111
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
117 |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
118 def test_empty_prop_val_executable(self): |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
119 repo = self._load_fixture_and_fetch('executable_file_empty_prop.svndump') |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
120 self.assertEqual(node.hex(repo['tip'].node()), |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
121 'b19e2bdd93da30b09c2396cfdb987cc85271249a') |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
122 self.assertEqual(repo['tip']['foo'].flags(), 'x') |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
123 |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
124 |
91
7d10165cf3d9
tests: Mock the mercurial.ui.ui class like we really should to capture output.
Augie Fackler <durin42@gmail.com>
parents:
78
diff
changeset
|
125 class TestStupidPull(test_util.TestBase): |
18
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
126 def test_stupid(self): |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
127 repo = test_util.load_fixture_and_fetch('two_heads.svndump', |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
128 self.repo_path, |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
129 self.wc_path, |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
130 True) |
18
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
131 # TODO there must be a better way than repo[0] for this check |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
132 self.assertEqual(node.hex(repo[0].node()), |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
133 'a47d0ce778660a91c31bf2c21c448e9ee296ac90') |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
134 self.assertEqual(node.hex(repo['tip'].node()), |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
135 'a595c77cfcaa3d1ba9e04b2c55c68bc6bf2b0fbf') |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
136 self.assertEqual(node.hex(repo['the_branch'].node()), |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
137 '8ccaba5f0eae124487e413abd904a013f7f6fdeb') |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
138 self.assertEqual(node.hex(repo['the_branch'].parents()[0].node()), |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
139 '9dfb0a19494f45c36e22f3c6d1b21d80638a7f6e') |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
140 self.assertEqual(len(repo['tip'].parents()), 1) |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
141 self.assertEqual(repo['tip'], repo['default']) |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
142 self.assertEqual(len(repo.heads()), 2) |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
143 |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
144 def test_oldest_not_trunk_and_tag_vendor_branch(self): |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
145 repo = test_util.load_fixture_and_fetch( |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
146 'tagged_vendor_and_oldest_not_trunk.svndump', |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
147 self.repo_path, |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
148 self.wc_path, |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
149 True) |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
150 repo = hg.repository(ui.ui(), self.wc_path) |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
151 self.assertEqual(node.hex(repo['oldest'].node()), |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
152 'd73002bcdeffe389a8df81ee43303d36e79e8ca4') |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
153 self.assertEqual(repo['tip'].parents()[0].parents()[0], |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
154 repo['oldest']) |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
155 self.assertEqual(node.hex(repo['tip'].node()), |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
156 '9cf09e6ff7fa938188c3bcc9dd87abd7842c080c') |
111
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
157 |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
158 def test_empty_prop_val_executable(self): |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
159 repo = test_util.load_fixture_and_fetch( |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
160 'executable_file_empty_prop.svndump', |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
161 self.repo_path, |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
162 self.wc_path, |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
163 True) |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
164 self.assertEqual(repo['tip']['foo'].flags(), 'x') |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
165 self.assertEqual(node.hex(repo['tip'].node()), |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
166 'b19e2bdd93da30b09c2396cfdb987cc85271249a') |
5497d1264b4d
fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
167 |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
43
diff
changeset
|
168 |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
15
diff
changeset
|
169 def suite(): |
18
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
170 all = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
171 unittest.TestLoader().loadTestsFromTestCase(TestStupidPull), |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
172 ] |
f4c751037a4a
Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents:
16
diff
changeset
|
173 return unittest.TestSuite(all) |