Mercurial > hgsubversion
annotate tests/test_utility_commands.py @ 1555:cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
It's been there since hg 1.7 or so, which lets us avoid any need for
compat shims.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sat, 24 Mar 2018 16:39:30 -0400 |
parents | 8410a978c650 |
children | d55c9d0ba350 |
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:
578
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:
578
diff
changeset
|
2 |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
3 import os |
153
46f6b872c988
tests: Fix some missing suite definitions so that running the full testsuite
Augie Fackler <durin42@gmail.com>
parents:
149
diff
changeset
|
4 import unittest |
880
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
5 import re |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
6 |
264
112d57bb736e
rebase: moved to wrappers, now a wrapper around rebase triggered with --svn.
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
7 from hgext import rebase |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
8 from mercurial import error as hgerror |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
9 from mercurial import hg |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
10 from mercurial import revlog |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
11 from mercurial import context |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
12 from mercurial import node |
347
537de0300510
Remove the 'outgoing' wrapper, and use the Mercurial infrastructure instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
337
diff
changeset
|
13 from mercurial import commands |
746
174f03c288d4
svnmeta: abort when no UUID given and none is stored on disk.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
743
diff
changeset
|
14 from mercurial import util as hgutil |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
15 |
337
46e69be8e2c8
Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents:
331
diff
changeset
|
16 from hgsubversion import util |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
17 from hgsubversion import svncommands |
897
6bc8046e3d0a
move verify to a file of its own
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
892
diff
changeset
|
18 from hgsubversion import verify |
337
46e69be8e2c8
Reorganize to have a more conventional module structure.
Augie Fackler <durin42@gmail.com>
parents:
331
diff
changeset
|
19 from hgsubversion import wrappers |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
20 from hgsubversion import compathacks |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
21 |
178
33ebdcb75bcd
test_utility_commands: fix normalized URL references under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
160
diff
changeset
|
22 expected_info_output = '''URL: %(repourl)s/%(branch)s |
33ebdcb75bcd
test_utility_commands: fix normalized URL references under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
160
diff
changeset
|
23 Repository Root: %(repourl)s |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
24 Repository UUID: df2126f7-00ab-4d49-b42c-7e981dde0bcf |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
25 Revision: %(rev)s |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
26 Node Kind: directory |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
27 Last Changed Author: durin |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
28 Last Changed Rev: %(rev)s |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
29 Last Changed Date: %(date)s |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
30 ''' |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
31 |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
32 def repourl(repo_path): |
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
33 return util.normalize_url(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:
264
diff
changeset
|
34 |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
35 class UtilityTests(test_util.TestBase): |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
36 stupid_mode_tests = True |
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
37 |
1092
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
38 def test_info_output(self, custom=False): |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
39 if custom: |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
40 config = { |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
41 'hgsubversionbranch.default': 'trunk', |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
42 'hgsubversionbranch.the_branch': 'branches/the_branch', |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
43 } |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
44 else: |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
45 config = {} |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
46 repo, repo_path = self.load_and_fetch('two_heads.svndump', config=config) |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
47 hg.update(self.repo, 'the_branch') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
48 u = self.ui() |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
49 u.pushbuffer() |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
50 svncommands.info(u, self.repo) |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
51 actual = u.popbuffer() |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
52 expected = (expected_info_output % |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
53 {'date': '2008-10-08 01:39:05 +0000 (Wed, 08 Oct 2008)', |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
54 'repourl': repourl(repo_path), |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
55 'branch': 'branches/the_branch', |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
56 'rev': 5, |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
57 }) |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
58 self.assertMultiLineEqual(actual, expected) |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
59 hg.update(self.repo, 'default') |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
60 u.pushbuffer() |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
61 svncommands.info(u, self.repo) |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
62 actual = u.popbuffer() |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
63 expected = (expected_info_output % |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
64 {'date': '2008-10-08 01:39:29 +0000 (Wed, 08 Oct 2008)', |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
65 'repourl': repourl(repo_path), |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
66 'branch': 'trunk', |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
67 'rev': 6, |
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
68 }) |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
69 self.assertMultiLineEqual(actual, expected) |
503
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
70 hg.update(self.repo, 'default') |
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
71 u.pushbuffer() |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
72 svncommands.info(u, self.repo, rev=3) |
503
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
73 actual = u.popbuffer() |
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
74 expected = (expected_info_output % |
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
75 {'date': '2008-10-08 01:39:05 +0000 (Wed, 08 Oct 2008)', |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
76 'repourl': repourl(repo_path), |
503
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
77 'branch': 'branches/the_branch', |
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
78 'rev': 5, |
00ecb2bc005c
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
Jason Ostrander <jason@sentilla.com>
parents:
403
diff
changeset
|
79 }) |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
80 self.assertMultiLineEqual(actual, expected) |
921
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
81 destpath = self.wc_path + '_clone' |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
82 test_util.hgclone(u, self.repo, destpath) |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
83 repo2 = hg.repository(u, destpath) |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
84 repo2.ui.setconfig('paths', 'default-push', |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
85 self.repo.ui.config('paths', 'default')) |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
86 hg.update(repo2, 'default') |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
87 svncommands.rebuildmeta(u, repo2, []) |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
88 u.pushbuffer() |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
89 svncommands.info(u, repo2) |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
90 actual = u.popbuffer() |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
91 expected = (expected_info_output % |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
92 {'date': '2008-10-08 01:39:29 +0000 (Wed, 08 Oct 2008)', |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
93 'repourl': repourl(repo_path), |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
94 'branch': 'trunk', |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
95 'rev': 6, |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
96 }) |
8faa91951bb1
svnremoterepo: use and prefer default-push
David Schleimer <dschleimer@fb.com>
parents:
918
diff
changeset
|
97 self.assertMultiLineEqual(actual, expected) |
139
89a737852d33
utility_commands: Add tests for url and info. Fix a bad mock in the process.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
98 |
1092
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
99 def test_info_output_custom(self): |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
100 self.test_info_output(custom=True) |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
101 |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
102 def test_info_single(self, custom=False): |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
103 if custom: |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
104 subdir=None |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
105 config = { |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
106 'hgsubversionbranch.default': 'trunk/' |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
107 } |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
108 else: |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
109 subdir='trunk' |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
110 config = {} |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
111 repo, repo_path = self.load_and_fetch('two_heads.svndump', |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
112 subdir=subdir, |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
113 config=config) |
549
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
114 hg.update(self.repo, 'tip') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
115 u = self.ui() |
549
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
116 u.pushbuffer() |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
117 svncommands.info(u, self.repo) |
549
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
118 actual = u.popbuffer() |
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
119 expected = (expected_info_output % |
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
120 {'date': '2008-10-08 01:39:29 +0000 (Wed, 08 Oct 2008)', |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
121 'repourl': repourl(repo_path), |
549
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
122 'branch': 'trunk', |
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
123 'rev': 6, |
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
124 }) |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
125 self.assertMultiLineEqual(expected, actual) |
549
b97f5734e5a8
utility_commands: unbreak hg svn info with single-directory clones
Augie Fackler <durin42@gmail.com>
parents:
503
diff
changeset
|
126 |
1092
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
127 def test_info_custom_single(self): |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
128 self.test_info_single(custom=True) |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
129 |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
130 def test_missing_metadata(self): |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
131 self._load_fixture_and_fetch('two_heads.svndump') |
1503
180e0d5fba2e
join: remove uses of repo.join/wjoin
Durham Goode <durham@fb.com>
parents:
1204
diff
changeset
|
132 os.remove(self.repo.vfs.join('svn/branch_info')) |
989
68191be64af8
updatemeta: fix missing errno import
Patrick Mezard <patrick@mezard.eu>
parents:
921
diff
changeset
|
133 svncommands.updatemeta(self.ui(), self.repo, []) |
68191be64af8
updatemeta: fix missing errno import
Patrick Mezard <patrick@mezard.eu>
parents:
921
diff
changeset
|
134 |
1503
180e0d5fba2e
join: remove uses of repo.join/wjoin
Durham Goode <durham@fb.com>
parents:
1204
diff
changeset
|
135 test_util.rmtree(self.repo.vfs.join('svn')) |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
136 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
137 self.repo.svnmeta) |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
138 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
139 svncommands.info, |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
140 self.ui(), repo=self.repo, args=[]) |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
141 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
142 svncommands.genignore, |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
143 self.ui(), repo=self.repo, args=[]) |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
144 |
1503
180e0d5fba2e
join: remove uses of repo.join/wjoin
Durham Goode <durham@fb.com>
parents:
1204
diff
changeset
|
145 os.remove(self.repo.vfs.join('hgrc')) |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
146 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
147 self.repo.svnmeta) |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
148 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
149 svncommands.info, |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
150 self.ui(), repo=self.repo, args=[]) |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
151 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
152 svncommands.genignore, |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
153 self.ui(), repo=self.repo, args=[]) |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
154 |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
155 self.assertRaises(hgerror.Abort, |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
156 svncommands.rebuildmeta, |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
746
diff
changeset
|
157 self.ui(), repo=self.repo, args=[]) |
746
174f03c288d4
svnmeta: abort when no UUID given and none is stored on disk.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
743
diff
changeset
|
158 |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
159 def test_parent_output(self): |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
160 self._load_fixture_and_fetch('two_heads.svndump') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
161 u = self.ui() |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
162 u.pushbuffer() |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
754
diff
changeset
|
163 parents = (self.repo['the_branch'].node(), revlog.nullid,) |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
164 def filectxfn(repo, memctx, path): |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
165 return compathacks.makememfilectx(repo, |
1549
8410a978c650
compathacks: be compatible with upstream 8a0cac20a1ad memfilectx change
Jun Wu <quark@fb.com>
parents:
1539
diff
changeset
|
166 memctx=memctx, |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
167 path=path, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
168 data='added', |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
169 islink=False, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
170 isexec=False, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
171 copied=False) |
1539
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
172 lr = self.repo |
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
173 ctx = context.memctx(lr, |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
174 parents, |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
175 'automated test', |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
176 ['added_bogus_file', 'other_added_file', ], |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
177 filectxfn, |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
178 'testy', |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
179 '2008-12-21 16:32:00 -0500', |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
180 {'branch': 'localbranch', }) |
1539
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
181 new = lr.commitctx(ctx) |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
182 hg.update(self.repo, new) |
403
37c96b78b8c0
uisetup: use a single loop/abstraction for wrapping all the commands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
183 wrappers.parents(lambda x, y: None, u, self.repo, svn=True) |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
184 actual = u.popbuffer() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
185 self.assertEqual(actual, '3:4e256962fc5d\n') |
256
7932d098cb5f
Refactor commands to wrap their hg equivalent adding a --svn flag where sane.
Augie Fackler <durin42@gmail.com>
parents:
253
diff
changeset
|
186 |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
187 hg.update(self.repo, 'default') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
188 |
256
7932d098cb5f
Refactor commands to wrap their hg equivalent adding a --svn flag where sane.
Augie Fackler <durin42@gmail.com>
parents:
253
diff
changeset
|
189 # Make sure styles work |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
190 u.pushbuffer() |
403
37c96b78b8c0
uisetup: use a single loop/abstraction for wrapping all the commands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
191 wrappers.parents(lambda x, y: None, u, self.repo, svn=True, style='compact') |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
192 actual = u.popbuffer() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
193 self.assertEqual(actual, '4:1083037b18d8\n') |
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
194 |
256
7932d098cb5f
Refactor commands to wrap their hg equivalent adding a --svn flag where sane.
Augie Fackler <durin42@gmail.com>
parents:
253
diff
changeset
|
195 # custom templates too |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
196 u.pushbuffer() |
403
37c96b78b8c0
uisetup: use a single loop/abstraction for wrapping all the commands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
197 wrappers.parents(lambda x, y: None, u, self.repo, svn=True, template='{node}\n') |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
198 actual = u.popbuffer() |
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
199 self.assertEqual(actual, '1083037b18d85cd84fa211c5adbaeff0fea2cd9f\n') |
256
7932d098cb5f
Refactor commands to wrap their hg equivalent adding a --svn flag where sane.
Augie Fackler <durin42@gmail.com>
parents:
253
diff
changeset
|
200 |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
201 u.pushbuffer() |
403
37c96b78b8c0
uisetup: use a single loop/abstraction for wrapping all the commands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
202 wrappers.parents(lambda x, y: None, u, self.repo, svn=True) |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
203 actual = u.popbuffer() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
204 self.assertEqual(actual, '4:1083037b18d8\n') |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
205 |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
206 def test_outgoing_output(self): |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
207 repo, repo_path = self.load_and_fetch('two_heads.svndump') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
208 u = self.ui() |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
754
diff
changeset
|
209 parents = (self.repo['the_branch'].node(), revlog.nullid,) |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
210 def filectxfn(repo, memctx, path): |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
211 return compathacks.makememfilectx(repo, |
1549
8410a978c650
compathacks: be compatible with upstream 8a0cac20a1ad memfilectx change
Jun Wu <quark@fb.com>
parents:
1539
diff
changeset
|
212 memctx=memctx, |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
213 path=path, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
214 data='added', |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
215 islink=False, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
216 isexec=False, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
217 copied=False) |
1539
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
218 lr = self.repo |
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
219 ctx = context.memctx(lr, |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
220 parents, |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
221 'automated test', |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
222 ['added_bogus_file', 'other_added_file', ], |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
223 filectxfn, |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
224 'testy', |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
225 '2008-12-21 16:32:00 -0500', |
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
226 {'branch': 'localbranch', }) |
1539
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
227 new = lr.commitctx(ctx) |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
228 hg.update(self.repo, new) |
347
537de0300510
Remove the 'outgoing' wrapper, and use the Mercurial infrastructure instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
337
diff
changeset
|
229 u.pushbuffer() |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
230 commands.outgoing(u, self.repo, repourl(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:
264
diff
changeset
|
231 actual = u.popbuffer() |
347
537de0300510
Remove the 'outgoing' wrapper, and use the Mercurial infrastructure instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
337
diff
changeset
|
232 self.assertTrue(node.hex(self.repo['localbranch'].node())[:8] in actual) |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
233 self.assertEqual(actual.strip(), '5:6de15430fa20') |
157
91541523ea5c
utility_commands: Test outgoing and fix it to work again.
Augie Fackler <durin42@gmail.com>
parents:
153
diff
changeset
|
234 hg.update(self.repo, 'default') |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
235 u.pushbuffer() |
867
50c13e01c7e3
test_util: add a load_and_fetch() returning the repo_path
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
236 commands.outgoing(u, self.repo, repourl(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:
264
diff
changeset
|
237 actual = u.popbuffer() |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
238 self.assertEqual(actual, '') |
140
9ffde8662967
util: Add a command to normalize svn urls and use it in a couple of places. Test that it works and prevents failed assertions.
Augie Fackler <durin42@gmail.com>
parents:
139
diff
changeset
|
239 |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
240 def test_rebase(self): |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
241 self._load_fixture_and_fetch('two_revs.svndump') |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
754
diff
changeset
|
242 parents = (self.repo[0].node(), revlog.nullid,) |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
243 def filectxfn(repo, memctx, path): |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
244 return compathacks.makememfilectx(repo, |
1549
8410a978c650
compathacks: be compatible with upstream 8a0cac20a1ad memfilectx change
Jun Wu <quark@fb.com>
parents:
1539
diff
changeset
|
245 memctx=memctx, |
1204
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
246 path=path, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
247 data='added', |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
248 islink=False, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
249 isexec=False, |
e73df57b2b07
test_utility_commands: call makememfilectx
Sean Farley <sean.michael.farley@gmail.com>
parents:
1092
diff
changeset
|
250 copied=False) |
1539
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
251 lr = self.repo |
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
252 ctx = context.memctx(lr, |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
253 parents, |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
254 'automated test', |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
255 ['added_bogus_file', 'other_added_file', ], |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
256 filectxfn, |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
257 'testy', |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
258 '2008-12-21 16:32:00 -0500', |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
259 {'branch': 'localbranch', }) |
1539
0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
Augie Fackler <raf@durin42.com>
parents:
1503
diff
changeset
|
260 lr.commitctx(ctx) |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
261 self.assertEqual(self.repo['tip'].branch(), 'localbranch') |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
262 beforerebasehash = self.repo['tip'].node() |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
263 hg.update(self.repo, 'tip') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
264 wrappers.rebase(rebase.rebase, self.ui(), self.repo, svn=True) |
149
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
265 self.assertEqual(self.repo['tip'].branch(), 'localbranch') |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
266 self.assertEqual(self.repo['tip'].parents()[0].parents()[0], self.repo[0]) |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
267 self.assertNotEqual(beforerebasehash, self.repo['tip'].node()) |
04800fda7af5
rebase: preserve local branch names.
Augie Fackler <durin42@gmail.com>
parents:
140
diff
changeset
|
268 |
1092
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
269 def test_genignore(self, layout='auto'): |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
270 """ Test generation of .hgignore file. """ |
1092
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
271 if layout == 'custom': |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
272 config = { |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
273 'hgsubversionbranch.default': 'trunk', |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
274 } |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
275 else: |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
276 config = {} |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
277 repo = self._load_fixture_and_fetch('ignores.svndump', |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
278 layout=layout, |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
279 noupdate=False, |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
280 config=config) |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
281 u = self.ui() |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
282 u.pushbuffer() |
865
04729f3a3d17
test_util: merge load_fixture_and_fetch() into TestBase method
Patrick Mezard <patrick@mezard.eu>
parents:
833
diff
changeset
|
283 svncommands.genignore(u, repo, self.wc_path) |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
284 self.assertMultiLineEqual(open(os.path.join(self.wc_path, '.hgignore')).read(), |
199
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
195
diff
changeset
|
285 '.hgignore\nsyntax:glob\nblah\notherblah\nbaz/magic\n') |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
195
diff
changeset
|
286 |
550
f0159775e0f1
utility_commands: fix hg svn genignore for single-directory mode
Augie Fackler <durin42@gmail.com>
parents:
549
diff
changeset
|
287 def test_genignore_single(self): |
1092
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
288 self.test_genignore(layout='single') |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
289 |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
290 def test_genignore_custom(self): |
cd0d14e25757
layouts: add custom layout for those of us that need weird mappings
David Schleimer <dschleimer@fb.com>
parents:
1077
diff
changeset
|
291 self.test_genignore(layout='custom') |
550
f0159775e0f1
utility_commands: fix hg svn genignore for single-directory mode
Augie Fackler <durin42@gmail.com>
parents:
549
diff
changeset
|
292 |
236
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
230
diff
changeset
|
293 def test_list_authors(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
865
diff
changeset
|
294 repo_path = self.load_svndump('replace_trunk_with_branch.svndump') |
576
d96aa92d9ad9
tests: silence test suite by using quiet UIs everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
295 u = self.ui() |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
296 u.pushbuffer() |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
297 svncommands.listauthors(u, |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
865
diff
changeset
|
298 args=[test_util.fileurl(repo_path)], |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
241
diff
changeset
|
299 authors=None) |
331
75f082b5897e
Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
264
diff
changeset
|
300 actual = u.popbuffer() |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
301 self.assertMultiLineEqual(actual, 'Augie\nevil\n') |
236
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
230
diff
changeset
|
302 |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
230
diff
changeset
|
303 def test_list_authors_map(self): |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
865
diff
changeset
|
304 repo_path = self.load_svndump('replace_trunk_with_branch.svndump') |
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
865
diff
changeset
|
305 author_path = os.path.join(repo_path, 'authors') |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
576
diff
changeset
|
306 svncommands.listauthors(self.ui(), |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
865
diff
changeset
|
307 args=[test_util.fileurl(repo_path)], |
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
865
diff
changeset
|
308 authors=author_path) |
743
045120d3a110
test_utility_commands: use self.assertMultiLineEqual().
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
643
diff
changeset
|
309 self.assertMultiLineEqual(open(author_path).read(), 'Augie=\nevil=\n') |
256
7932d098cb5f
Refactor commands to wrap their hg equivalent adding a --svn flag where sane.
Augie Fackler <durin42@gmail.com>
parents:
253
diff
changeset
|
310 |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
311 def test_svnverify(self): |
880
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
312 repo, repo_path = self.load_and_fetch('binaryfiles.svndump', |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
313 noupdate=False) |
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
314 ret = verify.verify(self.ui(), repo, [], rev=1) |
880
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
315 self.assertEqual(0, ret) |
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
316 repo_path = self.load_svndump('binaryfiles-broken.svndump') |
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
317 u = self.ui() |
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
318 u.pushbuffer() |
899
7f90bb48c9de
svn verify: use a custom editor and get_revision()
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
897
diff
changeset
|
319 ret = verify.verify(u, repo, [test_util.fileurl(repo_path)], |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
320 rev=1) |
880
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
321 output = u.popbuffer() |
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
322 self.assertEqual(1, ret) |
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
323 output = re.sub(r'file://\S+', 'file://', output) |
887
f95c429124f3
make assertion failures slightly prettier and more readable
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
881
diff
changeset
|
324 self.assertMultiLineEqual("""\ |
880
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
325 verifying d51f46a715a1 against file:// |
892
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
326 difference in: binary2 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
327 unexpected file: binary1 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
328 missing file: binary3 |
880
d4312a6f7a87
test_utility_commands: test verify command
Patrick Mezard <patrick@mezard.eu>
parents:
867
diff
changeset
|
329 """, output) |
153
46f6b872c988
tests: Fix some missing suite definitions so that running the full testsuite
Augie Fackler <durin42@gmail.com>
parents:
149
diff
changeset
|
330 |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
331 def test_corruption(self): |
892
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
332 SUCCESS = 0 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
333 FAILURE = 1 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
334 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
335 repo, repo_path = self.load_and_fetch('correct.svndump', layout='single', |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
336 subdir='') |
892
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
337 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
338 ui = self.ui() |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
339 |
1077
8f3a241b790d
test_utility_commands: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
340 self.assertEqual(SUCCESS, verify.verify(ui, self.repo, rev='tip')) |
892
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
341 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
342 corrupt_source = test_util.fileurl(self.load_svndump('corrupt.svndump')) |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
343 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
344 repo.ui.setconfig('paths', 'default', corrupt_source) |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
345 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
346 ui.pushbuffer() |
897
6bc8046e3d0a
move verify to a file of its own
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
892
diff
changeset
|
347 code = verify.verify(ui, repo, rev='tip') |
892
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
348 actual = ui.popbuffer() |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
349 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
350 actual = actual.replace(corrupt_source, '$REPO') |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
351 actual = set(actual.splitlines()) |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
352 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
353 expected = set([ |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
354 'verifying 78e965230a13 against $REPO@1', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
355 'missing file: missing-file', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
356 'wrong flags for: executable-file', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
357 'wrong flags for: symlink', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
358 'wrong flags for: regular-file', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
359 'difference in: another-regular-file', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
360 'difference in: regular-file', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
361 'unexpected file: empty-file', |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
362 ]) |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
363 |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
364 self.assertEqual((FAILURE, expected), (code, actual)) |
3bfb7e985c47
svn verify: add a test for corrupt repositories.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
887
diff
changeset
|
365 |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
366 def test_svnrebuildmeta(self): |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
367 otherpath = self.load_svndump('binaryfiles-broken.svndump') |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
368 otherurl = test_util.fileurl(otherpath) |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
369 self.load_and_fetch('replace_trunk_with_branch.svndump') |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
370 # rebuildmeta with original repo |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
371 svncommands.rebuildmeta(self.ui(), repo=self.repo, args=[]) |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
372 # rebuildmeta with unrelated repo |
1555
cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
Augie Fackler <raf@durin42.com>
parents:
1549
diff
changeset
|
373 self.assertRaises(hgerror.Abort, |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
374 svncommands.rebuildmeta, |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
375 self.ui(), repo=self.repo, args=[otherurl]) |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
376 # rebuildmeta --unsafe-skip-uuid-check with unrelated repo |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
377 svncommands.rebuildmeta(self.ui(), repo=self.repo, args=[otherurl], |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
899
diff
changeset
|
378 unsafe_skip_uuid_check=True) |