Mercurial > hgsubversion
annotate tests/test_fetch_mappings.py @ 1414:99bc6003ac56
maps: add the "exists" method to RevMap
This is a part of the bigger plan to get rid of reading or writing rev_map
directly without going through the RevMap class.
Before this patch, there is no easy way to know if the RevMap file exists
or not, so the revset functions "fromsvn" and "svnrev" choose to read the
rev_map file directly, and throw an exception if the file does not exist.
This patch adds the "exists" method that will be used in svnmeta next patch,
so these revset functions can test if the file exists without reading the
rev_map file directly.
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 13 May 2016 23:19:15 +0100 |
parents | 94eb844fd4ab |
children | 3a723188051e |
rev | line source |
---|---|
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
1 """Tests for author maps and file maps. |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
2 """ |
643
d2ef7220a079
tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
641
diff
changeset
|
3 import test_util |
d2ef7220a079
tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
641
diff
changeset
|
4 |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
5 import os |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
6 import unittest |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
7 |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
257
diff
changeset
|
8 from mercurial import commands |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
9 from mercurial import hg |
179
a336e3e82648
Fetch: add a filemap argument for use in converting old repositories to
Graham Booker <gbooker@cod3r.com>
parents:
168
diff
changeset
|
10 from mercurial import node |
636
d4f433ee709a
branchmap: reject empty mappings
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
635
diff
changeset
|
11 from mercurial import util as hgutil |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
12 |
430
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
13 from hgsubversion import maps |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
14 from hgsubversion import svncommands |
769
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
15 from hgsubversion import util |
899
7f90bb48c9de
svn verify: use a custom editor and get_revision()
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
897
diff
changeset
|
16 from hgsubversion import verify |
430
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
17 |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
18 class MapTests(test_util.TestBase): |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
19 stupid_mode_tests = True |
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
20 |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
21 @property |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
22 def authors(self): |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
23 return os.path.join(self.tmpdir, 'authormap') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
24 |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
25 @property |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
26 def filemap(self): |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
27 return os.path.join(self.tmpdir, 'filemap') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
28 |
574
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
29 @property |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
30 def branchmap(self): |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
31 return os.path.join(self.tmpdir, 'branchmap') |
822
033b86e0f56d
stupid/filemap: disable this since it doesn't currently work
Augie Fackler <durin42@gmail.com>
parents:
816
diff
changeset
|
32 |
729 | 33 @property |
34 def tagmap(self): | |
35 return os.path.join(self.tmpdir, 'tagmap') | |
574
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
36 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
37 def test_author_map(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
38 repo_path = self.load_svndump('replace_trunk_with_branch.svndump') |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
39 authormap = open(self.authors, 'w') |
360
27e9fea5d114
Author maps: strip comments.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
358
diff
changeset
|
40 authormap.write('Augie=Augie Fackler <durin42@gmail.com> # stuffy\n') |
358
2c0649064455
Author maps: handle lines without = gracefully.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
331
diff
changeset
|
41 authormap.write("Augie Fackler <durin42@gmail.com>\n") |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
42 authormap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
43 ui = self.ui() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
574
diff
changeset
|
44 ui.setconfig('hgsubversion', 'authormap', self.authors) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
45 commands.clone(ui, test_util.fileurl(repo_path), |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
257
diff
changeset
|
46 self.wc_path, authors=self.authors) |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
47 self.assertEqual(self.repo[0].user(), |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
48 'Augie Fackler <durin42@gmail.com>') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
49 self.assertEqual(self.repo['tip'].user(), |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
50 'evil@5b65bade-98f3-4993-a01f-b7a6710da339') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
51 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
52 def test_author_map_closing_author(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
53 repo_path = self.load_svndump('replace_trunk_with_branch.svndump') |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
54 authormap = open(self.authors, 'w') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
55 authormap.write("evil=Testy <test@test>") |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
56 authormap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
57 ui = self.ui() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
574
diff
changeset
|
58 ui.setconfig('hgsubversion', 'authormap', self.authors) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
59 commands.clone(ui, test_util.fileurl(repo_path), |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
257
diff
changeset
|
60 self.wc_path, authors=self.authors) |
168
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
61 self.assertEqual(self.repo[0].user(), |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
62 'Augie@5b65bade-98f3-4993-a01f-b7a6710da339') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
63 self.assertEqual(self.repo['tip'].user(), |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
64 'Testy <test@test>') |
4f26fa049452
authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
65 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
66 def test_author_map_no_author(self): |
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
67 repo, repo_path = self.load_and_fetch('no-author.svndump') |
735
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
68 users = set(self.repo[r].user() for r in self.repo) |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
69 expected_users = ['(no author)@%s' % self.repo.svnmeta().uuid] |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
70 self.assertEqual(sorted(users), expected_users) |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
71 test_util.rmtree(self.wc_path) |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
72 |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
73 authormap = open(self.authors, 'w') |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
74 authormap.write("(no author)=Testy <test@example.com>") |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
75 authormap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
76 ui = self.ui() |
735
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
77 ui.setconfig('hgsubversion', 'authormap', self.authors) |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
78 commands.clone(ui, test_util.fileurl(repo_path), |
735
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
79 self.wc_path, authors=self.authors) |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
80 users = set(self.repo[r].user() for r in self.repo) |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
81 expected_users = ['Testy <test@example.com>'] |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
82 self.assertEqual(sorted(users), expected_users) |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
729
diff
changeset
|
83 |
430
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
84 def test_author_map_no_overwrite(self): |
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
85 cwd = os.path.dirname(__file__) |
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
86 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt') |
1194
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
87 # create a fake hgsubversion repo |
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
88 repopath = os.path.join(self.wc_path, '.hg') |
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
89 repopath = os.path.join(repopath, 'svn') |
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
90 if not os.path.isdir(repopath): |
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
91 os.makedirs(repopath) |
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
92 new = open(os.path.join(repopath, 'authors'), 'w') |
430
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
93 new.write(open(orig).read()) |
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
94 new.close() |
1194
49791c40a8a5
maps: change authormap to initialize with an svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1098
diff
changeset
|
95 test = maps.AuthorMap(self.repo.svnmeta(skiperrorcheck=True)) |
430
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
96 fromself = set(test) |
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
97 test.load(orig) |
833
312b37bc5e20
tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents:
822
diff
changeset
|
98 all_tests = set(test) |
312b37bc5e20
tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents:
822
diff
changeset
|
99 self.assertEqual(fromself.symmetric_difference(all_tests), set()) |
430
2851b81c65ce
maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
360
diff
changeset
|
100 |
1097
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
101 def test_author_map_caseignore(self): |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
102 repo_path = self.load_svndump('replace_trunk_with_branch.svndump') |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
103 authormap = open(self.authors, 'w') |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
104 authormap.write('augie=Augie Fackler <durin42@gmail.com> # stuffy\n') |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
105 authormap.write("Augie Fackler <durin42@gmail.com>\n") |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
106 authormap.close() |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
107 ui = self.ui() |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
108 ui.setconfig('hgsubversion', 'authormap', self.authors) |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
109 ui.setconfig('hgsubversion', 'caseignoreauthors', True) |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
110 commands.clone(ui, test_util.fileurl(repo_path), |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
111 self.wc_path, authors=self.authors) |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
112 self.assertEqual(self.repo[0].user(), |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
113 'Augie Fackler <durin42@gmail.com>') |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
114 self.assertEqual(self.repo['tip'].user(), |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
115 'evil@5b65bade-98f3-4993-a01f-b7a6710da339') |
e015cd34168d
authormap: allow case-insensitive authormaps for easier conversions
maugustin
parents:
1058
diff
changeset
|
116 |
1374
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
117 def test_author_map_mapauthorscmd(self): |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
118 repo_path = self.load_svndump('replace_trunk_with_branch.svndump') |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
119 ui = self.ui() |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
120 ui.setconfig('hgsubversion', 'mapauthorscmd', 'echo "svn: %s"') |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
121 commands.clone(ui, test_util.fileurl(repo_path), |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
122 self.wc_path) |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
123 self.assertEqual(self.repo[0].user(), 'svn: Augie') |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
124 self.assertEqual(self.repo['tip'].user(), 'svn: evil') |
a17d8874a099
Added dynamic author mapping.
Jerome M. BERGER <jeberger@free.fr>
parents:
1356
diff
changeset
|
125 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
126 def _loadwithfilemap(self, svndump, filemapcontent, |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
127 failonmissing=True): |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
128 repo_path = self.load_svndump(svndump) |
179
a336e3e82648
Fetch: add a filemap argument for use in converting old repositories to
Graham Booker <gbooker@cod3r.com>
parents:
168
diff
changeset
|
129 filemap = open(self.filemap, 'w') |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
130 filemap.write(filemapcontent) |
179
a336e3e82648
Fetch: add a filemap argument for use in converting old repositories to
Graham Booker <gbooker@cod3r.com>
parents:
168
diff
changeset
|
131 filemap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
132 ui = self.ui() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
574
diff
changeset
|
133 ui.setconfig('hgsubversion', 'filemap', self.filemap) |
960
502613f6b583
editor: ignore added or copied files excluded by a filemap
Patrick Mezard <patrick@mezard.eu>
parents:
954
diff
changeset
|
134 ui.setconfig('hgsubversion', 'failoninvalidreplayfile', 'true') |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
135 ui.setconfig('hgsubversion', 'failonmissing', failonmissing) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
136 commands.clone(ui, test_util.fileurl(repo_path), |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
257
diff
changeset
|
137 self.wc_path, filemap=self.filemap) |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
138 return self.repo |
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
139 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
140 @test_util.requiresreplay |
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
141 def test_file_map(self): |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
142 repo = self._loadwithfilemap('replace_trunk_with_branch.svndump', |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
143 "include alpha\n") |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
144 self.assertEqual(node.hex(repo[0].node()), '88e2c7492d83e4bf30fbb2dcbf6aa24d60ac688d') |
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
145 self.assertEqual(node.hex(repo['default'].node()), 'e524296152246b3837fe9503c83b727075835155') |
203
907c160c6289
Refactor branch handling to be much more dynamic (and hopefully robust).
Augie Fackler <durin42@gmail.com>
parents:
179
diff
changeset
|
146 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
147 @test_util.requiresreplay |
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
148 def test_file_map_exclude(self): |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
149 repo = self._loadwithfilemap('replace_trunk_with_branch.svndump', |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
150 "exclude alpha\n") |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
151 self.assertEqual(node.hex(repo[0].node()), '2c48f3525926ab6c8b8424bcf5eb34b149b61841') |
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
152 self.assertEqual(node.hex(repo['default'].node()), 'b37a3c0297b71f989064d9b545b5a478bbed7cc1') |
203
907c160c6289
Refactor branch handling to be much more dynamic (and hopefully robust).
Augie Fackler <durin42@gmail.com>
parents:
179
diff
changeset
|
153 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
154 @test_util.requiresreplay |
847
0de18c5c2e35
Respect filemap rule order (rules that come first are overridden by rules that come later)
Vitaliy Filippov <vitalif@yourcmc.ru>
parents:
833
diff
changeset
|
155 def test_file_map_rule_order(self): |
954
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
156 repo = self._loadwithfilemap('replace_trunk_with_branch.svndump', |
1f77bd6ec0e5
test_fetch_mappings: reduce copy/paste
Patrick Mezard <patrick@mezard.eu>
parents:
930
diff
changeset
|
157 "exclude alpha\ninclude .\nexclude gamma\n") |
848
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
158 # The exclusion of alpha is overridden by the later rule to |
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
159 # include all of '.', whereas gamma should remain excluded |
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
160 # because it's excluded after the root directory. |
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
161 self.assertEqual(self.repo[0].manifest().keys(), |
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
162 ['alpha', 'beta']) |
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
163 self.assertEqual(self.repo['default'].manifest().keys(), |
4e203a47102a
filemap tests: check the attributes we care about, rather than shas
Augie Fackler <durin42@gmail.com>
parents:
847
diff
changeset
|
164 ['alpha', 'beta']) |
847
0de18c5c2e35
Respect filemap rule order (rules that come first are overridden by rules that come later)
Vitaliy Filippov <vitalif@yourcmc.ru>
parents:
833
diff
changeset
|
165 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
166 @test_util.requiresreplay |
960
502613f6b583
editor: ignore added or copied files excluded by a filemap
Patrick Mezard <patrick@mezard.eu>
parents:
954
diff
changeset
|
167 def test_file_map_copy(self): |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
168 # Exercise excluding files copied from a non-excluded directory. |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
169 # There will be missing files as we are copying from an excluded |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
170 # directory. |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
171 repo = self._loadwithfilemap('copies.svndump', "exclude dir2\n", |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
172 failonmissing=False) |
963
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
173 self.assertEqual(['dir/a', 'dir3/a'], list(repo[2])) |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
174 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
175 @test_util.requiresreplay |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
176 def test_file_map_exclude_copy_source_and_dest(self): |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
177 # dir3 is excluded and copied from dir2 which is also excluded. |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
178 # dir3 files should not be marked as missing and fetched. |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
179 repo = self._loadwithfilemap('copies.svndump', |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
180 "exclude dir2\nexclude dir3\n") |
963
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
181 self.assertEqual(['dir/a'], list(repo[2])) |
960
502613f6b583
editor: ignore added or copied files excluded by a filemap
Patrick Mezard <patrick@mezard.eu>
parents:
954
diff
changeset
|
182 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
183 @test_util.requiresreplay |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
184 def test_file_map_include_file_exclude_dir(self): |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
185 # dir3 is excluded but we want dir3/a, which is also copied from |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
186 # an exluded dir2. dir3/a should be fetched. |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
187 repo = self._loadwithfilemap('copies.svndump', |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
188 "include .\nexclude dir2\nexclude dir3\ninclude dir3/a\n", |
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
189 failonmissing=False) |
963
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
190 self.assertEqual(['dir/a', 'dir3/a'], list(repo[2])) |
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
191 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
192 @test_util.requiresreplay |
963
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
193 def test_file_map_delete_dest(self): |
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
194 repo = self._loadwithfilemap('copies.svndump', 'exclude dir3\n') |
64d961130a07
editor: do not record invalid path deletion
Patrick Mezard <patrick@mezard.eu>
parents:
962
diff
changeset
|
195 self.assertEqual(['dir/a', 'dir2/a'], list(repo[3])) |
962
8648ccfb8325
editor: process missing files with regular files
Patrick Mezard <patrick@mezard.eu>
parents:
960
diff
changeset
|
196 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
197 def test_branchmap(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
198 repo_path = self.load_svndump('branchmap.svndump') |
574
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
199 branchmap = open(self.branchmap, 'w') |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
200 branchmap.write("badname = good-name # stuffy\n") |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
201 branchmap.write("feature = default\n") |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
202 branchmap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
203 ui = self.ui() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
574
diff
changeset
|
204 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
205 commands.clone(ui, test_util.fileurl(repo_path), |
574
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
206 self.wc_path, branchmap=self.branchmap) |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
207 branches = set(self.repo[i].branch() for i in self.repo) |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
208 self.assert_('badname' not in branches) |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
209 self.assert_('good-name' in branches) |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
210 self.assertEquals(self.repo[2].branch(), 'default') |
8e025a6f0db4
add basic branchmap functionality, to rename branches
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
430
diff
changeset
|
211 |
1402
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
212 def test_branchmap_regex_and_glob(self): |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
213 repo_path = self.load_svndump('branchmap.svndump') |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
214 branchmap = open(self.branchmap, 'w') |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
215 branchmap.write("syntax:re\n") |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
216 branchmap.write("bad(.*) = good-\\1 # stuffy\n") |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
217 branchmap.write("glob:feat* = default\n") |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
218 branchmap.close() |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
219 ui = self.ui() |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
220 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
221 commands.clone(ui, test_util.fileurl(repo_path), |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
222 self.wc_path, branchmap=self.branchmap) |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
223 branches = set(self.repo[i].branch() for i in self.repo) |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
224 self.assert_('badname' not in branches) |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
225 self.assert_('good-name' in branches) |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
226 self.assertEquals(self.repo[2].branch(), 'default') |
94eb844fd4ab
tests: add test for regex and glob
Sean Farley <sean.michael.farley@gmail.com>
parents:
1374
diff
changeset
|
227 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
228 def test_branchmap_tagging(self): |
634
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
229 '''test tagging a renamed branch, which used to raise an exception''' |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
230 repo_path = self.load_svndump('commit-to-tag.svndump') |
634
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
231 branchmap = open(self.branchmap, 'w') |
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
232 branchmap.write("magic = art\n") |
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
233 branchmap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
234 ui = self.ui() |
634
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
235 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
236 commands.clone(ui, test_util.fileurl(repo_path), |
634
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
237 self.wc_path, branchmap=self.branchmap) |
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
238 branches = set(self.repo[i].branch() for i in self.repo) |
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
239 self.assertEquals(sorted(branches), ['art', 'closeme']) |
a400f3bf5611
replay/stupid: fix tagging on a branch renamed using a branch map
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
576
diff
changeset
|
240 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
241 def test_branchmap_empty_commit(self): |
635
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
242 '''test mapping an empty commit on a renamed branch''' |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
243 repo_path = self.load_svndump('propset-branch.svndump') |
635
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
244 branchmap = open(self.branchmap, 'w') |
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
245 branchmap.write("the-branch = bob\n") |
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
246 branchmap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
247 ui = self.ui() |
635
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
248 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
249 commands.clone(ui, test_util.fileurl(repo_path), |
635
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
250 self.wc_path, branchmap=self.branchmap) |
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
251 branches = set(self.repo[i].branch() for i in self.repo) |
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
252 self.assertEquals(sorted(branches), ['bob', 'default']) |
e2c3349b2cca
branchmap: map empty commits in replay mode.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
634
diff
changeset
|
253 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
254 def test_branchmap_combine(self): |
639
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
255 '''test combining two branches, but retaining heads''' |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
256 repo_path = self.load_svndump('branchmap.svndump') |
639
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
257 branchmap = open(self.branchmap, 'w') |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
258 branchmap.write("badname = default\n") |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
259 branchmap.write("feature = default\n") |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
260 branchmap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
261 ui = self.ui() |
639
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
262 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
263 commands.clone(ui, test_util.fileurl(repo_path), |
639
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
264 self.wc_path, branchmap=self.branchmap) |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
265 branches = set(self.repo[i].branch() for i in self.repo) |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
266 self.assertEquals(sorted(branches), ['default']) |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
267 self.assertEquals(len(self.repo.heads()), 2) |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
268 self.assertEquals(len(self.repo.branchheads('default')), 2) |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
269 |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
270 # test that the mapping does not affect branch info |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
271 branches = self.repo.svnmeta().branches |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
272 self.assertEquals(sorted(branches.keys()), |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
273 [None, 'badname', 'feature']) |
b2c8c2079822
tests: add test for combining two branches using the branchmap
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
636
diff
changeset
|
274 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
275 def test_branchmap_rebuildmeta(self): |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
276 '''test rebuildmeta on a branchmapped clone''' |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
277 repo_path = self.load_svndump('branchmap.svndump') |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
278 branchmap = open(self.branchmap, 'w') |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
279 branchmap.write("badname = dit\n") |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
280 branchmap.write("feature = dah\n") |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
281 branchmap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
282 ui = self.ui() |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
283 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
284 commands.clone(ui, test_util.fileurl(repo_path), |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
285 self.wc_path, branchmap=self.branchmap) |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
286 originfo = self.repo.svnmeta().branches |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
287 |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
288 # clone & rebuild |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
289 ui = self.ui() |
816
86d124a8768e
Fix hg.clone() calls changed by d976542986d2
Patrick Mezard <pmezard@gmail.com>
parents:
770
diff
changeset
|
290 src, dest = test_util.hgclone(ui, self.wc_path, self.wc_path + '_clone', |
86d124a8768e
Fix hg.clone() calls changed by d976542986d2
Patrick Mezard <pmezard@gmail.com>
parents:
770
diff
changeset
|
291 update=False) |
930
5bacb9c63e3e
Fix more peer breakage with old hg versions
Patrick Mezard <patrick@mezard.eu>
parents:
916
diff
changeset
|
292 src = test_util.getlocalpeer(src) |
5bacb9c63e3e
Fix more peer breakage with old hg versions
Patrick Mezard <patrick@mezard.eu>
parents:
916
diff
changeset
|
293 dest = test_util.getlocalpeer(dest) |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
294 svncommands.rebuildmeta(ui, dest, |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
295 args=[test_util.fileurl(repo_path)]) |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
296 |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
297 # just check the keys; assume the contents are unaffected by the branch |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
298 # map and thus properly tested by other tests |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
299 self.assertEquals(sorted(src.svnmeta().branches), |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
300 sorted(dest.svnmeta().branches)) |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
639
diff
changeset
|
301 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
302 def test_branchmap_verify(self): |
702
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
303 '''test verify on a branchmapped clone''' |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
304 repo_path = self.load_svndump('branchmap.svndump') |
702
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
305 branchmap = open(self.branchmap, 'w') |
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
306 branchmap.write("badname = dit\n") |
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
307 branchmap.write("feature = dah\n") |
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
308 branchmap.close() |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
309 ui = self.ui() |
702
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
310 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
311 commands.clone(ui, test_util.fileurl(repo_path), |
702
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
312 self.wc_path, branchmap=self.branchmap) |
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
313 repo = self.repo |
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
314 |
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
315 for r in repo: |
897
6bc8046e3d0a
move verify to a file of its own
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
867
diff
changeset
|
316 self.assertEquals(verify.verify(ui, repo, rev=r), 0) |
702
841399d10c79
verify: fix verifying mapped branches.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
317 |
1356
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
318 def test_branchmap_no_replacement(self): |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
319 '''test that empty mappings are accepted |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
320 |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
321 Empty mappings are lines like 'this ='. We check that such branches are |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
322 not converted. |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
323 ''' |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
324 repo_path = self.load_svndump('branchmap.svndump') |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
325 branchmap = open(self.branchmap, 'w') |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
326 branchmap.write("badname =\n") |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
327 branchmap.close() |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
328 ui = self.ui() |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
329 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
330 commands.clone(ui, test_util.fileurl(repo_path), |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
331 self.wc_path, branchmap=self.branchmap) |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
332 branches = set(self.repo[i].branch() for i in self.repo) |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
333 self.assertEquals(sorted(branches), ['default', 'feature']) |
57d65269d30c
maps: allow an empty map to not convert specific branches
Sean Farley <sean@farley.io>
parents:
1215
diff
changeset
|
334 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
335 def test_tagmap(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
336 repo_path = self.load_svndump('basic_tag_tests.svndump') |
729 | 337 tagmap = open(self.tagmap, 'w') |
338 tagmap.write("tag_r3 = 3.x # stuffy\n") | |
339 tagmap.write("copied_tag = \n") | |
340 tagmap.close() | |
341 | |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
342 ui = self.ui() |
729 | 343 ui.setconfig('hgsubversion', 'tagmap', self.tagmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
344 commands.clone(ui, test_util.fileurl(repo_path), |
729 | 345 self.wc_path, tagmap=self.tagmap) |
346 tags = self.repo.tags() | |
347 assert 'tag_r3' not in tags | |
348 assert '3.x' in tags | |
349 assert 'copied_tag' not in tags | |
350 | |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
351 def test_tagren_changed(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
352 repo_path = self.load_svndump('commit-to-tag.svndump') |
729 | 353 tagmap = open(self.tagmap, 'w') |
354 tagmap.write("edit-at-create = edit-past\n") | |
355 tagmap.write("also-edit = \n") | |
356 tagmap.write("will-edit = edit-future\n") | |
357 tagmap.close() | |
358 | |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
359 ui = self.ui() |
729 | 360 ui.setconfig('hgsubversion', 'tagmap', self.tagmap) |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
848
diff
changeset
|
361 commands.clone(ui, test_util.fileurl(repo_path), |
729 | 362 self.wc_path, tagmap=self.tagmap) |
363 tags = self.repo.tags() | |
364 | |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
365 def test_empty_log_message(self): |
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
366 repo, repo_path = self.load_and_fetch('empty-log-message.svndump') |
769
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
367 |
770
4dfc41b15d9a
make the default substition for an empty commit description the empty string
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
769
diff
changeset
|
368 self.assertEqual(repo['tip'].description(), '') |
769
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
369 |
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
370 test_util.rmtree(self.wc_path) |
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
371 |
1058
bc71d8c8fde9
filemap tests: use stupid mode metaclass & decorator
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
372 ui = self.ui() |
769
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
373 ui.setconfig('hgsubversion', 'defaultmessage', 'blyf') |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
374 commands.clone(ui, test_util.fileurl(repo_path), self.wc_path) |
769
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
375 |
cc1d4aa3ba41
configurable substitution for empty commit message (fixes #195)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
768
diff
changeset
|
376 self.assertEqual(self.repo['tip'].description(), 'blyf') |