annotate tests/test_fetch_command.py @ 1594:41c6b3e39a03

Added signature for changeset 207a0f26f797
author Augie Fackler <raf@durin42.com>
date Fri, 02 Nov 2018 23:35:15 -0400
parents e2d38f6b8afe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
643
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 569
diff changeset
1 import test_util
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 569
diff changeset
2
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
3 import os
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4 import unittest
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
5 import urllib
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
7 from mercurial import commands
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 from mercurial import hg
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 from mercurial import node
195
906d3f302b45 Remove useless imports.
Augie Fackler <durin42@gmail.com>
parents: 154
diff changeset
10 from mercurial import ui
924
e252f9355933 test_fetch_command: fix if local encoding is not UTF-8
Patrick Mezard <patrick@mezard.eu>
parents: 910
diff changeset
11 from mercurial import encoding
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
13 revsymbol = test_util.revsymbol
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
14
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
15 class TestBasicRepoLayout(test_util.TestBase):
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
16 stupid_mode_tests = True
237
c90cfa665b81 Cope with date-less revisions.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 218
diff changeset
17
c90cfa665b81 Cope with date-less revisions.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 218
diff changeset
18 def test_no_dates(self):
c90cfa665b81 Cope with date-less revisions.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 218
diff changeset
19 repo = self._load_fixture_and_fetch('test_no_dates.svndump')
245
f8e9b74df403 Fix test_no_dates to not be TZ-sensitive.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 237
diff changeset
20 local_epoch = repo[0].date()
f8e9b74df403 Fix test_no_dates to not be TZ-sensitive.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 237
diff changeset
21 self.assertEqual(local_epoch[0], local_epoch[1])
237
c90cfa665b81 Cope with date-less revisions.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 218
diff changeset
22 self.assertEqual(repo[1].date(), repo[2].date())
c90cfa665b81 Cope with date-less revisions.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 218
diff changeset
23
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
24 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
25 repo = self._load_fixture_and_fetch('single_rev.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
26 self.assertEqual(node.hex(revsymbol(repo, 'tip').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
27 '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
28 self.assertEqual(revsymbol(repo, 'tip').extra()['convert_revision'],
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
29 'svn:df2126f7-00ab-4d49-b42c-7e981dde0bcf/trunk@2')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
30 self.assertEqual(revsymbol(repo, 'tip'), repo[0])
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
31
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
32 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
33 repo = self._load_fixture_and_fetch('two_revs.svndump')
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
34 self.assertEqual(node.hex(repo[0].node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
35 '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
36 self.assertEqual(node.hex(revsymbol(repo, 'tip').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
37 'c95251e0dd04697deee99b79cc407d7db76e6a5f')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
38 self.assertEqual(revsymbol(repo, 'tip'), repo[1])
15
db32dee803a8 Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents: 14
diff changeset
39
db32dee803a8 Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents: 14
diff changeset
40 def test_branches(self):
22
95d0109e495e Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents: 21
diff changeset
41 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
42 self.assertEqual(node.hex(repo[0].node()),
542
bb00f7ca5b8c Rewrite simple_branch.sh fixture from svn dump
Patrick Mezard <pmezard@gmail.com>
parents: 263
diff changeset
43 'a1ff9f5d90852ce7f8e607fa144066b0a06bdc57')
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
44 self.assertTrue(node.hex(revsymbol(repo, 'tip').node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
45 ('545e36ed13615e39c5c8fb0c325109d8cb8e00c3',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
46 '04043a3f29a7070b1ea56d6ef832591956a41381'))
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
47 self.assertEqual(len(revsymbol(repo, 'tip').parents()), 1)
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
48 self.assertEqual(revsymbol(repo, 'tip').parents()[0], revsymbol(repo, 'default'))
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
49 self.assertEqual(revsymbol(repo, 'tip').extra()['convert_revision'],
542
bb00f7ca5b8c Rewrite simple_branch.sh fixture from svn dump
Patrick Mezard <pmezard@gmail.com>
parents: 263
diff changeset
50 'svn:3cd547df-371e-4add-bccf-aba732a2baf5/branches/the_branch@4')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
51 self.assertEqual(revsymbol(repo, 'default').extra()['convert_revision'],
542
bb00f7ca5b8c Rewrite simple_branch.sh fixture from svn dump
Patrick Mezard <pmezard@gmail.com>
parents: 263
diff changeset
52 'svn:3cd547df-371e-4add-bccf-aba732a2baf5/trunk@3')
15
db32dee803a8 Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents: 14
diff changeset
53 self.assertEqual(len(repo.heads()), 1)
db32dee803a8 Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents: 14
diff changeset
54
db32dee803a8 Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents: 14
diff changeset
55 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
56 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
57 self.assertEqual(node.hex(repo[0].node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
58 '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
59 self.assertEqual(node.hex(revsymbol(repo, 'tip').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
60 '1083037b18d85cd84fa211c5adbaeff0fea2cd9f')
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
61 # two hashes to be compat with hg < 4.8 because from 4.8 we try hard to
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
62 # reuse the manifest
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
63 self.assertTrue(node.hex(revsymbol(repo, 'the_branch').node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
64 ('4e256962fc5df545e2e0a51d0d1dc61c469127e6',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
65 '13c5dc1514ad8619c589a8929bfe0ece5c00f18e'))
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
66 self.assertTrue(node.hex(revsymbol(repo, 'the_branch').parents()[0].node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
67 ('f1ff5b860f5dbb9a59ad0921a79da77f10f25109',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
68 '62f4e5fb583a405df3dae62c156461a0f44219f2'))
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
69 self.assertEqual(len(revsymbol(repo, 'tip').parents()), 1)
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
70 self.assertEqual(revsymbol(repo, 'tip'), revsymbol(repo, 'default'))
15
db32dee803a8 Add some basic tests of branching.
Augie Fackler <durin42@gmail.com>
parents: 14
diff changeset
71 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
72
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
73 def test_many_special_cases(self):
22
95d0109e495e Refactor tests so I can reuse code more.
Augie Fackler <durin42@gmail.com>
parents: 21
diff changeset
74 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
75
569
95eca255739e test_fetch_command: handle changes in revision extra ordering gracefully
Augie Fackler <durin42@gmail.com>
parents: 542
diff changeset
76 self.assertEquals(node.hex(repo[0].node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
77 '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
569
95eca255739e test_fetch_command: handle changes in revision extra ordering gracefully
Augie Fackler <durin42@gmail.com>
parents: 542
diff changeset
78 # two possible hashes for bw compat to hg < 1.5, since hg 1.5
95eca255739e test_fetch_command: handle changes in revision extra ordering gracefully
Augie Fackler <durin42@gmail.com>
parents: 542
diff changeset
79 # sorts entries in extra()
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
80 self.assertTrue(node.hex(revsymbol(repo, 'tip').node()) in
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
81 ('e92012d8c170a0236c84166167f149c2e28548c6',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
82 'b7bdc73041b1852563deb1ef3f4153c2fe4484f2'))
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
83 # two possible hashes for backward compatibility with hg < 4.8
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
84 self.assertTrue(node.hex(revsymbol(repo, 'the_branch').node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
85 ('4e256962fc5df545e2e0a51d0d1dc61c469127e6',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
86 '13c5dc1514ad8619c589a8929bfe0ece5c00f18e'))
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
87 self.assertTrue(node.hex(revsymbol(repo, 'the_branch').parents()[0].node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
88 ('f1ff5b860f5dbb9a59ad0921a79da77f10f25109',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
89 '62f4e5fb583a405df3dae62c156461a0f44219f2'))
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
90 self.assertEqual(len(revsymbol(repo, 'tip').parents()), 1)
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
91 self.assertEqual(revsymbol(repo, 'tip'), revsymbol(repo, 'default'))
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 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
93
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
94 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
95 repo = self._load_fixture_and_fetch('file_mixed_with_branches.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
96 self.assertEqual(node.hex(revsymbol(repo, 'default').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
97 '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
1578
68965b2e3401 tests: use repo['.'] instead of repo to check whether file exists
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1570
diff changeset
98 assert 'README' not in repo['.']
68965b2e3401 tests: use repo['.'] instead of repo to check whether file exists
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1570
diff changeset
99 assert '../branches' not in repo['.']
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
100
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
101 def test_files_copied_from_outside_btt(self):
41
496c0354019c Improved handling of copies from outside of trunk.
Augie Fackler <durin42@gmail.com>
parents: 40
diff changeset
102 repo = self._load_fixture_and_fetch(
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
103 'test_files_copied_from_outside_btt.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
104 self.assertEqual(node.hex(revsymbol(repo, 'tip').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
105 '3c78170e30ddd35f2c32faa0d8646ab75bba4f73')
1463
86ae03f889a4 test_util: allow counting converted revisions
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1084
diff changeset
106 self.assertEqual(test_util.repolen(repo), 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
107
43
af7ac6c03452 Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents: 41
diff changeset
108 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
109 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
110 'file_renamed_in_from_outside_btt.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
111 self.assert_('LICENSE.file' in revsymbol(repo, 'default'))
43
af7ac6c03452 Fix a bug with added files from outside branches/trunk/tags.
Augie Fackler <durin42@gmail.com>
parents: 41
diff changeset
112
112
e58c2f1de059 Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents: 111
diff changeset
113 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
114 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
115 'fetch_missing_files_subdir.svndump', subdir='foo')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
116 self.assertEqual(node.hex(revsymbol(repo, 'tip').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
117 '269dcdd4361b2847e9f4288d4500e55d35df1f52')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
118 self.assert_('bar/alpha' in revsymbol(repo, 'tip'))
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
119 self.assert_('foo' in revsymbol(repo, 'tip'))
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
120 self.assert_('bar/alpha' not in revsymbol(repo, 'tip').parents()[0])
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
121 self.assert_('foo' in revsymbol(repo, 'tip').parents()[0])
112
e58c2f1de059 Fix a regression in converting repositories with files copied in from outside
Augie Fackler <durin42@gmail.com>
parents: 111
diff changeset
122
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 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
124 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
125 'tagged_vendor_and_oldest_not_trunk.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
126 self.assertEqual(node.hex(revsymbol(repo, 'oldest').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
127 '926671740dec045077ab20f110c1595f935334fa')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
128 self.assertEqual(revsymbol(repo, 'tip').parents()[0].parents()[0],
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
129 revsymbol(repo, 'oldest'))
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
130 # two hashes for backward compatibility with hg < 4.8 because from 4.8,
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
131 # we try hard to reuse the manifest
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
132 self.assertTrue(node.hex(revsymbol(repo, 'tip').node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
133 ('1a6c3f30911d57abb67c257ec0df3e7bc44786f7',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
134 'fa799f2781255dba874645e849d75af837472518'))
111
5497d1264b4d fetch_command: Fix mis-converted executable when svn:executable was set to the
Augie Fackler <durin42@gmail.com>
parents: 101
diff changeset
135
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
136 def test_propedit_with_nothing_else(self):
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
137 repo = self._load_fixture_and_fetch('branch_prop_edit.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
138 self.assertEqual(revsymbol(repo, 'tip').description(), 'Commit bogus propchange.')
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
139 self.assertEqual(revsymbol(repo, 'tip').branch(), 'dev_branch')
136
cf6fe8457570 Fix an apparent regression where branch name didn't get properly stored for
Augie Fackler <durin42@gmail.com>
parents: 135
diff changeset
140
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
141 def test_entry_deletion(self):
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
142 repo = self._load_fixture_and_fetch('delentries.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
143 files = list(sorted(revsymbol(repo, 'tip').manifest()))
144
19aabf67c792 test_fetch_command: test file and directory deletions
Patrick Mezard <pmezard@gmail.com>
parents: 138
diff changeset
144 self.assertEqual(['aa', 'd1/c', 'd1/d2prefix'], files)
19aabf67c792 test_fetch_command: test file and directory deletions
Patrick Mezard <pmezard@gmail.com>
parents: 138
diff changeset
145
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
146 def test_fetch_when_trunk_has_no_files(self):
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
147 repo = self._load_fixture_and_fetch('file_not_in_trunk_root.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
148 self.assertEqual(revsymbol(repo, 'tip').branch(), 'default')
207
b20a6c149021 fetch: Fix a bogus case where no files in the root level of trunk caused breakage in the branch detection.
Augie Fackler <durin42@gmail.com>
parents: 203
diff changeset
149
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
150 def test_path_quoting(self):
866
20e73b5ab6f7 test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents: 865
diff changeset
151 repo_path = self.load_svndump('non_ascii_path_1.svndump')
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
152 subdir = '/b\xC3\xB8b'
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
153 quoted_subdir = urllib.quote(subdir)
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
154
866
20e73b5ab6f7 test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents: 865
diff changeset
155 repo_url = test_util.fileurl(repo_path)
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
156 wc_path = self.wc_path
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
157 wc2_path = wc_path + '-2'
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
158
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
159 ui = self.ui()
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
160
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
161 commands.clone(ui, repo_url + subdir, wc_path)
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
162 commands.clone(ui, repo_url + quoted_subdir, wc2_path)
832
e9af7eba88db globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents: 717
diff changeset
163 repo = hg.repository(ui, wc_path)
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
164 repo2 = hg.repository(ui, wc2_path)
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
165
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
166 self.assertEqual(revsymbol(repo, 'tip').extra()['convert_revision'],
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
167 repo2['tip'].extra()['convert_revision'])
1048
903c9c9dfe6a tests: count revisions explicitly
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1045
diff changeset
168 self.assertEqual(test_util.repolen(repo), test_util.repolen(repo2))
717
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
169
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
170 for r in repo:
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
171 self.assertEqual(repo[r].hex(), repo2[r].hex())
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
172
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
173 def test_identical_fixtures(self):
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
174 '''ensure that the non_ascii_path_N fixtures are identical'''
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
175 fixturepaths = [
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
176 os.path.join(test_util.FIXTURES, 'non_ascii_path_1.svndump'),
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
177 os.path.join(test_util.FIXTURES, 'non_ascii_path_2.svndump'),
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
178 ]
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
179 self.assertMultiLineEqual(open(fixturepaths[0]).read(),
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
180 open(fixturepaths[1]).read())
ae5968ffe6fe svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 643
diff changeset
181
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
182 def test_invalid_message(self):
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
183 repo = self._load_fixture_and_fetch('invalid_utf8.tar.gz')
924
e252f9355933 test_fetch_command: fix if local encoding is not UTF-8
Patrick Mezard <patrick@mezard.eu>
parents: 910
diff changeset
184 # changelog returns descriptions in local encoding
e252f9355933 test_fetch_command: fix if local encoding is not UTF-8
Patrick Mezard <patrick@mezard.eu>
parents: 910
diff changeset
185 desc = encoding.fromlocal(repo[0].description())
e252f9355933 test_fetch_command: fix if local encoding is not UTF-8
Patrick Mezard <patrick@mezard.eu>
parents: 910
diff changeset
186 self.assertEqual(desc.decode('utf8'),
910
312f36a425f0 Ignore invalid utf8 in commit messages
David Schleimer <dschleimer@fb.com>
parents: 866
diff changeset
187 u'bl\xe5b\xe6rgr\xf8d')
312f36a425f0 Ignore invalid utf8 in commit messages
David Schleimer <dschleimer@fb.com>
parents: 866
diff changeset
188
312f36a425f0 Ignore invalid utf8 in commit messages
David Schleimer <dschleimer@fb.com>
parents: 866
diff changeset
189
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
190 class TestStupidPull(test_util.TestBase):
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
191 stupid_mode_tests = True
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
192
18
f4c751037a4a Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents: 16
diff changeset
193 def test_stupid(self):
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
194 repo = self._load_fixture_and_fetch('two_heads.svndump')
18
f4c751037a4a Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents: 16
diff changeset
195 self.assertEqual(node.hex(repo[0].node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
196 '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
197 self.assertEqual(node.hex(revsymbol(repo, 'tip').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
198 '1083037b18d85cd84fa211c5adbaeff0fea2cd9f')
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
199 # two hashes to be compat with hg < 4.8
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
200 self.assertTrue(node.hex(revsymbol(repo, 'the_branch').node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
201 ('4e256962fc5df545e2e0a51d0d1dc61c469127e6',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
202 '13c5dc1514ad8619c589a8929bfe0ece5c00f18e'))
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
203 self.assertEqual(revsymbol(repo, 'the_branch').extra()['convert_revision'],
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
204 'svn:df2126f7-00ab-4d49-b42c-7e981dde0bcf/branches/the_branch@5')
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
205 self.assertTrue(node.hex(revsymbol(repo, 'the_branch').parents()[0].node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
206 ('f1ff5b860f5dbb9a59ad0921a79da77f10f25109',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
207 '62f4e5fb583a405df3dae62c156461a0f44219f2'))
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
208 self.assertEqual(len(revsymbol(repo, 'tip').parents()), 1)
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
209 self.assertEqual(revsymbol(repo, 'default').extra()['convert_revision'],
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
210 'svn:df2126f7-00ab-4d49-b42c-7e981dde0bcf/trunk@6')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
211 self.assertEqual(revsymbol(repo, 'tip'), revsymbol(repo, 'default'))
18
f4c751037a4a Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents: 16
diff changeset
212 self.assertEqual(len(repo.heads()), 2)
f4c751037a4a Add a quick test for diff-based pull.
Augie Fackler <durin42@gmail.com>
parents: 16
diff changeset
213
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
214 def test_oldest_not_trunk_and_tag_vendor_branch(self):
865
04729f3a3d17 test_util: merge load_fixture_and_fetch() into TestBase method
Patrick Mezard <patrick@mezard.eu>
parents: 833
diff changeset
215 repo = self._load_fixture_and_fetch(
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
216 'tagged_vendor_and_oldest_not_trunk.svndump')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
217 self.assertEqual(node.hex(revsymbol(repo, 'oldest').node()),
154
6fa97cfbf62f fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents: 144
diff changeset
218 '926671740dec045077ab20f110c1595f935334fa')
1570
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
219 self.assertEqual(revsymbol(repo, 'tip').parents()[0].parents()[0],
d55c9d0ba350 tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
Paul Morelle <paul.morelle@octobus.net>
parents: 1463
diff changeset
220 revsymbol(repo, 'oldest'))
1588
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
221 # two hashes to be compat with hg < 4.8
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
222 self.assertTrue(node.hex(revsymbol(repo, 'tip').node()) in
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
223 ('1a6c3f30911d57abb67c257ec0df3e7bc44786f7',
e2d38f6b8afe tests: make output comaptible with hash changes in hg-4.8
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 1578
diff changeset
224 'fa799f2781255dba874645e849d75af837472518'))
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
225
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
226 def test_empty_repo(self):
938
f9014e28721b editor: start separating svn copies from open files
Patrick Mezard <patrick@mezard.eu>
parents: 924
diff changeset
227 # This used to crash HgEditor because it could be closed without
f9014e28721b editor: start separating svn copies from open files
Patrick Mezard <patrick@mezard.eu>
parents: 924
diff changeset
228 # having been initialized again.
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
229 self._load_fixture_and_fetch('emptyrepo2.svndump')
938
f9014e28721b editor: start separating svn copies from open files
Patrick Mezard <patrick@mezard.eu>
parents: 924
diff changeset
230
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
231 def test_fetch_revert(self):
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
232 repo = self._load_fixture_and_fetch('revert.svndump')
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
233 graph = self.getgraph(repo)
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
234 refgraph = """\
1084
ca36d5915dc7 test_util: include Subversion revision when drawing a pretty graph
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1062
diff changeset
235 o changeset: 3:937dcd1206d4 (r4)
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
236 | branch:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
237 | tags: tip
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
238 | summary: revert2
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
239 | files: a dir/b
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
240 |
1084
ca36d5915dc7 test_util: include Subversion revision when drawing a pretty graph
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1062
diff changeset
241 o changeset: 2:9317a748b7c3 (r3)
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
242 | branch:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
243 | tags:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
244 | summary: revert
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
245 | files: a dir/b
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
246 |
1084
ca36d5915dc7 test_util: include Subversion revision when drawing a pretty graph
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1062
diff changeset
247 o changeset: 1:243259a4138a (r2)
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
248 | branch:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
249 | tags:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
250 | summary: changefiles
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
251 | files: a dir/b
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
252 |
1084
ca36d5915dc7 test_util: include Subversion revision when drawing a pretty graph
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1062
diff changeset
253 o changeset: 0:ab86791fc857 (r1)
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
254 branch:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
255 tags:
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
256 summary: init
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
257 files: a dir/b
1051
c41e993f0892 test_fetch_commands: make a failure more readable
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents: 1048
diff changeset
258
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
259 """
1051
c41e993f0892 test_fetch_commands: make a failure more readable
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents: 1048
diff changeset
260 self.assertMultiLineEqual(refgraph, graph)
952
9c3b4f59e7e6 stupid: do not close branch upon branch-wide revert
Patrick Mezard <patrick@mezard.eu>
parents: 950
diff changeset
261
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
262 def test_fetch_movetotrunk(self):
961
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
263 repo = self._load_fixture_and_fetch('movetotrunk.svndump',
1062
36a5fa6420a0 test_fetch_command: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1051
diff changeset
264 subdir='sub1/sub2')
961
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
265 graph = self.getgraph(repo)
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
266 refgraph = """\
1084
ca36d5915dc7 test_util: include Subversion revision when drawing a pretty graph
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 1062
diff changeset
267 o changeset: 0:02996a5980ba (r3)
961
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
268 branch:
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
269 tags: tip
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
270 summary: move to trunk
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
271 files: a dir/b
1051
c41e993f0892 test_fetch_commands: make a failure more readable
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents: 1048
diff changeset
272
961
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
273 """
1051
c41e993f0892 test_fetch_commands: make a failure more readable
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents: 1048
diff changeset
274 self.assertMultiLineEqual(refgraph, graph)
961
b729909d3793 tests: add tests where files are moved from root to trunk
Patrick Mezard <patrick@mezard.eu>
parents: 952
diff changeset
275