annotate tests/test_externals.py @ 762:c31a1f92e1c6

svnexternals: preliminary support for subrepos based externals At this point, only pulling externals definitions into .hgsub and .hgsubstate is supported. One difference between subrepos and svn:externals is the former separate the source definition and target revision in two files, while svn:externals definitions contain both. To handle this, the svn:externals revision references is replaced with a {REV} placeholder and stored in .hgsub, prefixed with the external base directory separated with a ':', while the revision is extracted in .hgsubstate. For instance, the following external: -r3 ^/externals/proj2@2 deps/proj2 Becomes: (.hgsub) deps/proj2 = [hgsubversion] :-r{REV} ^/externals/proj2@2 deps/proj2 (.hgsubstate) 3 deps/proj2
author Patrick Mezard <pmezard@gmail.com>
date Thu, 25 Nov 2010 21:55:21 +0100
parents 979148947967
children 6463b34bbcb6
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: 576
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: 576
diff changeset
2
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
3 import os, unittest
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
4
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
5 from mercurial import commands
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6
337
46e69be8e2c8 Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents: 315
diff changeset
7 from hgsubversion import svnexternals
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 class TestFetchExternals(test_util.TestBase):
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 def test_externalsfile(self):
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 f = svnexternals.externalsfile()
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 f['t1'] = 'dir1 -r10 svn://foobar'
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 f['t 2'] = 'dir2 -r10 svn://foobar'
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 f['t3'] = ['dir31 -r10 svn://foobar', 'dir32 -r10 svn://foobar']
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
15
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
16 refext = """[t 2]
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 dir2 -r10 svn://foobar
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 [t1]
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 dir1 -r10 svn://foobar
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 [t3]
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 dir31 -r10 svn://foobar
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 dir32 -r10 svn://foobar
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 """
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 value = f.write()
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 self.assertEqual(refext, value)
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 f2 = svnexternals.externalsfile()
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 f2.read(value)
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 self.assertEqual(sorted(f), sorted(f2))
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 for t in f:
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31 self.assertEqual(f[t], f2[t])
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
33 def test_parsedefinitions(self):
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
34 # Taken from svn book
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
35 samples = [
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
36 ('third-party/sounds http://svn.example.com/repos/sounds',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
37 ('third-party/sounds', None, 'http://svn.example.com/repos/sounds', None,
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
38 'third-party/sounds http://svn.example.com/repos/sounds')),
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
39
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
40 ('third-party/skins -r148 http://svn.example.com/skinproj',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
41 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None,
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
42 'third-party/skins -r{REV} http://svn.example.com/skinproj')),
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
43
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
44 ('third-party/skins -r 148 http://svn.example.com/skinproj',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
45 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None,
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
46 'third-party/skins -r {REV} http://svn.example.com/skinproj')),
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
47
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
48 ('http://svn.example.com/repos/sounds third-party/sounds',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
49 ('third-party/sounds', None, 'http://svn.example.com/repos/sounds', None,
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
50 'http://svn.example.com/repos/sounds third-party/sounds')),
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
51
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
52 ('-r148 http://svn.example.com/skinproj third-party/skins',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
53 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None,
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
54 '-r{REV} http://svn.example.com/skinproj third-party/skins')),
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
55
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
56 ('-r 148 http://svn.example.com/skinproj third-party/skins',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
57 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None,
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
58 '-r {REV} http://svn.example.com/skinproj third-party/skins')),
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
59
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
60 ('http://svn.example.com/skin-maker@21 third-party/skins/toolkit',
761
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
61 ('third-party/skins/toolkit', None, 'http://svn.example.com/skin-maker', '21',
979148947967 svnexternals: generate externals with a revision placeholder
Patrick Mezard <pmezard@gmail.com>
parents: 643
diff changeset
62 'http://svn.example.com/skin-maker@21 third-party/skins/toolkit')),
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
63 ]
337
46e69be8e2c8 Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents: 315
diff changeset
64
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
65 for line, expected in samples:
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
66 self.assertEqual(expected, svnexternals.parsedefinition(line))
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
67
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
68 def test_externals(self, stupid=False):
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
69 repo = self._load_fixture_and_fetch('externals.svndump', stupid=stupid)
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
70
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
71 ref0 = """[.]
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
72 ^/externals/project1 deps/project1
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
73 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
74 self.assertEqual(ref0, repo[0]['.hgsvnexternals'].data())
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
75 ref1 = """[.]
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
76 ^/externals/project1 deps/project1
315
963d27a0b1c2 svnexternals: do not use peg revisions as --rev replacements
Patrick Mezard <pmezard@gmail.com>
parents: 291
diff changeset
77 -r2 ^/externals/project2@2 deps/project2
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
78 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
79 self.assertEqual(ref1, repo[1]['.hgsvnexternals'].data())
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
80
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
81 ref2 = """[.]
315
963d27a0b1c2 svnexternals: do not use peg revisions as --rev replacements
Patrick Mezard <pmezard@gmail.com>
parents: 291
diff changeset
82 -r2 ^/externals/project2@2 deps/project2
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
83 [subdir]
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
84 ^/externals/project1 deps/project1
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
85 [subdir2]
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
86 ^/externals/project1 deps/project1
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
87 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
88 actual = repo[2]['.hgsvnexternals'].data()
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
89 self.assertEqual(ref2, actual)
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
90
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
91 ref3 = """[.]
315
963d27a0b1c2 svnexternals: do not use peg revisions as --rev replacements
Patrick Mezard <pmezard@gmail.com>
parents: 291
diff changeset
92 -r2 ^/externals/project2@2 deps/project2
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
93 [subdir]
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
94 ^/externals/project1 deps/project1
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
95 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
96 self.assertEqual(ref3, repo[3]['.hgsvnexternals'].data())
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
97
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
98 ref4 = """[subdir]
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
99 ^/externals/project1 deps/project1
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
100 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
101 self.assertEqual(ref4, repo[4]['.hgsvnexternals'].data())
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
102
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
103 ref5 = """[.]
315
963d27a0b1c2 svnexternals: do not use peg revisions as --rev replacements
Patrick Mezard <pmezard@gmail.com>
parents: 291
diff changeset
104 -r2 ^/externals/project2@2 deps/project2
184
d3ea6c98a086 Do not recurse for externals on copied directory in stupid mode
Patrick Mezard <pmezard@gmail.com>
parents: 183
diff changeset
105 [subdir2]
d3ea6c98a086 Do not recurse for externals on copied directory in stupid mode
Patrick Mezard <pmezard@gmail.com>
parents: 183
diff changeset
106 ^/externals/project1 deps/project1
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
107 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
108 self.assertEqual(ref5, repo[5]['.hgsvnexternals'].data())
183
1c46ad3f56aa test_externals: test branch copy, use absolute externals
Patrick Mezard <pmezard@gmail.com>
parents: 176
diff changeset
109
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
110 ref6 = """[.]
315
963d27a0b1c2 svnexternals: do not use peg revisions as --rev replacements
Patrick Mezard <pmezard@gmail.com>
parents: 291
diff changeset
111 -r2 ^/externals/project2@2 deps/project2
184
d3ea6c98a086 Do not recurse for externals on copied directory in stupid mode
Patrick Mezard <pmezard@gmail.com>
parents: 183
diff changeset
112 """
218
a360ddc97719 branches: change handling again, but this time a little less magic.
Augie Fackler <durin42@gmail.com>
parents: 215
diff changeset
113 self.assertEqual(ref6, repo[6]['.hgsvnexternals'].data())
184
d3ea6c98a086 Do not recurse for externals on copied directory in stupid mode
Patrick Mezard <pmezard@gmail.com>
parents: 183
diff changeset
114
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
115 def test_externals_stupid(self):
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
116 self.test_externals(True)
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
117
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
118 def test_updateexternals(self):
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
119 def checkdeps(deps, nodeps, repo, rev=None):
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
120 svnexternals.updateexternals(ui, [rev], repo)
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
121 for d in deps:
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
122 p = os.path.join(repo.root, d)
337
46e69be8e2c8 Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents: 315
diff changeset
123 self.assertTrue(os.path.isdir(p),
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
124 'missing: %s@%r' % (d, rev))
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
125 for d in nodeps:
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
126 p = os.path.join(repo.root, d)
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
127 self.assertTrue(not os.path.isdir(p),
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
128 'unexpected: %s@%r' % (d, rev))
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
129
576
d96aa92d9ad9 tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 337
diff changeset
130 ui = self.ui()
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
131 repo = self._load_fixture_and_fetch('externals.svndump', stupid=0)
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
132 commands.update(ui, repo)
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
133 checkdeps(['deps/project1'], [], repo, 0)
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
134 checkdeps(['deps/project1', 'deps/project2'], [], repo, 1)
337
46e69be8e2c8 Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents: 315
diff changeset
135 checkdeps(['subdir/deps/project1', 'subdir2/deps/project1',
46e69be8e2c8 Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents: 315
diff changeset
136 'deps/project2'],
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
137 ['deps/project1'], repo, 2)
337
46e69be8e2c8 Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents: 315
diff changeset
138 checkdeps(['subdir/deps/project1', 'deps/project2'],
291
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
139 ['subdir2/deps/project1'], repo, 3)
ba8e91a7c077 Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents: 218
diff changeset
140 checkdeps(['subdir/deps/project1'], ['deps/project2'], repo, 4)
175
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
141
762
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
142 def test_hgsub(self, stupid=False):
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
143 repo = self._load_fixture_and_fetch('externals.svndump',
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
144 externals='subrepos',
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
145 stupid=stupid)
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
146 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
147 deps/project1 = [hgsubversion] :^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
148 """, repo[0]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
149 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
150 HEAD deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
151 """, repo[0]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
152
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
153 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
154 deps/project1 = [hgsubversion] :^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
155 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
156 """, repo[1]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
157 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
158 HEAD deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
159 2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
160 """, repo[1]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
161
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
162 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
163 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
164 subdir/deps/project1 = [hgsubversion] subdir:^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
165 subdir2/deps/project1 = [hgsubversion] subdir2:^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
166 """, repo[2]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
167 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
168 2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
169 HEAD subdir/deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
170 HEAD subdir2/deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
171 """, repo[2]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
172
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
173 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
174 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
175 subdir/deps/project1 = [hgsubversion] subdir:^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
176 """, repo[3]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
177 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
178 2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
179 HEAD subdir/deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
180 """, repo[3]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
181
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
182 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
183 subdir/deps/project1 = [hgsubversion] subdir:^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
184 """, repo[4]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
185 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
186 HEAD subdir/deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
187 """, repo[4]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
188
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
189 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
190 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
191 subdir2/deps/project1 = [hgsubversion] subdir2:^/externals/project1 deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
192 """, repo[5]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
193 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
194 2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
195 HEAD subdir2/deps/project1
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
196 """, repo[5]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
197
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
198 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
199 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
200 """, repo[6]['.hgsub'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
201 self.assertEqual("""\
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
202 2 deps/project2
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
203 """, repo[6]['.hgsubstate'].data())
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
204
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
205 def test_hgsub_stupid(self):
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
206 self.test_hgsub(True)
c31a1f92e1c6 svnexternals: preliminary support for subrepos based externals
Patrick Mezard <pmezard@gmail.com>
parents: 761
diff changeset
207
175
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
208 class TestPushExternals(test_util.TestBase):
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
209 def setUp(self):
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
210 test_util.TestBase.setUp(self)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
211 test_util.load_fixture_and_fetch('pushexternals.svndump',
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
212 self.repo_path,
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
213 self.wc_path)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
214
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
215 def test_push_externals(self, stupid=False):
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
216 # Add a new reference on an existing and non-existing directory
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
217 changes = [
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
218 ('.hgsvnexternals', '.hgsvnexternals',
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
219 """[dir]
175
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
220 ../externals/project2 deps/project2
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
221 [subdir1]
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
222 ../externals/project1 deps/project1
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
223 [subdir2]
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
224 ../externals/project2 deps/project2
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
225 """),
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
226 ('subdir1/a', 'subdir1/a', 'a'),
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
227 ('subdir2/a', 'subdir2/a', 'a'),
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
228 ]
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
229 self.commitchanges(changes)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
230 self.pushrevisions(stupid)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
231 self.assertchanges(changes, self.repo['tip'])
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
232
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
233 # Remove all references from one directory, add a new one
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
234 # to the other (test multiline entries)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
235 changes = [
215
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
236 ('.hgsvnexternals', '.hgsvnexternals',
b5ef9a404f5d Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Augie Fackler <durin42@gmail.com>
parents: 195
diff changeset
237 """[subdir1]
175
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
238 ../externals/project1 deps/project1
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
239 ../externals/project2 deps/project2
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
240 """),
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
241 # This removal used to trigger the parent directory removal
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
242 ('subdir1/a', None, None),
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
243 ]
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
244 self.commitchanges(changes)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
245 self.pushrevisions(stupid)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
246 self.assertchanges(changes, self.repo['tip'])
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
247 # Check subdir2/a is still there even if the externals were removed
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
248 self.assertTrue('subdir2/a' in self.repo['tip'])
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
249 self.assertTrue('subdir1/a' not in self.repo['tip'])
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
250
176
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
251 # Test externals removal
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
252 changes = [
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
253 ('.hgsvnexternals', None, None),
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
254 ]
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
255 self.commitchanges(changes)
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
256 self.pushrevisions(stupid)
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
257 self.assertchanges(changes, self.repo['tip'])
c4115b3918e9 Really delete the .hgsvnexternals file when explicitely removed
Patrick Mezard <pmezard@gmail.com>
parents: 175
diff changeset
258
175
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
259 def test_push_externals_stupid(self):
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
260 self.test_push_externals(True)
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
261
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
262
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
263 def suite():
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
264 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchExternals),
175
2412800b1258 Support svn:externals changes via .hgsvnexternals updates
Patrick Mezard <pmezard@gmail.com>
parents: 174
diff changeset
265 unittest.TestLoader().loadTestsFromTestCase(TestPushExternals),
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
266 ]
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
267 return unittest.TestSuite(all)