Mercurial > hgsubversion
annotate tests/test_push_command.py @ 306:e6853c7fa3af
hg_delta_editor: fix _split_tag_path to actually work as intended.
I don't remember why I wrote this function, but it might be useful.
This changeset passes all tests, although I couldn't remember how to
run the comprehensive test suite.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Fri, 01 May 2009 13:25:57 +0200 |
parents | 3848a7f9b983 |
children | 75f082b5897e |
rev | line source |
---|---|
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
1 import os |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
2 import socket |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
3 import subprocess |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
4 import unittest |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
5 |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
6 from mercurial import context |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
7 from mercurial import hg |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
8 from mercurial import node |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
9 from mercurial import ui |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
10 from mercurial import revlog |
277
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
11 from mercurial import util as hgutil |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
12 |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
13 import wrappers |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
14 import test_util |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
15 import time |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
16 |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
17 |
82
71de43e9f614
Extract PushTest common code into test_util.TestBase
Patrick Mezard <pmezard@gmail.com>
parents:
80
diff
changeset
|
18 class PushOverSvnserveTests(test_util.TestBase): |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
19 def setUp(self): |
82
71de43e9f614
Extract PushTest common code into test_util.TestBase
Patrick Mezard <pmezard@gmail.com>
parents:
80
diff
changeset
|
20 test_util.TestBase.setUp(self) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
21 test_util.load_svndump_fixture(self.repo_path, 'simple_branch.svndump') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
22 open(os.path.join(self.repo_path, 'conf', 'svnserve.conf'), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
23 'w').write('[general]\nanon-access=write\n[sasl]\n') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
24 # Paranoia: we try and connect to localhost on 3689 before we start |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
25 # svnserve. If it is running, we force the test to fail early. |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
26 user_has_own_svnserve = False |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
27 try: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
28 s = socket.socket() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
29 s.settimeout(0.3) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
30 s.connect(('localhost', 3690)) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
31 s.close() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
32 user_has_own_svnserve = True |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
33 except: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
34 pass |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
35 if user_has_own_svnserve: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
36 assert False, ('You appear to be running your own svnserve!' |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
37 ' You can probably ignore this test failure.') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
38 args = ['svnserve', '-d', '--foreground', '-r', self.repo_path] |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
39 self.svnserve_pid = subprocess.Popen(args).pid |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
40 time.sleep(2) |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
41 wrappers.clone(None, ui.ui(), source='svn://localhost/', |
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
42 dest=self.wc_path, noupdate=True) |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
43 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
44 def tearDown(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
45 os.system('kill -9 %d' % self.svnserve_pid) |
82
71de43e9f614
Extract PushTest common code into test_util.TestBase
Patrick Mezard <pmezard@gmail.com>
parents:
80
diff
changeset
|
46 test_util.TestBase.tearDown(self) |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
47 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
48 def test_push_to_default(self, commit=True): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
49 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
50 old_tip = repo['tip'].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
51 expected_parent = repo['default'].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
52 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
53 if path == 'adding_file': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
54 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
55 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
56 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
57 isexec=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
58 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
59 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
60 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
61 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
62 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
63 ['adding_file'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
64 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
65 'an_author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
66 '2008-10-07 20:59:48 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
67 {'branch': 'default',}) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
68 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
69 if not commit: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
70 return # some tests use this test as an extended setup. |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
71 hg.update(repo, repo['tip'].node()) |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
72 oldauthor = repo['tip'].user() |
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
73 wrappers.push(None, ui.ui(), repo=self.repo) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
74 tip = self.repo['tip'] |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
75 self.assertNotEqual(oldauthor, tip.user()) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
76 self.assertNotEqual(tip.node(), old_tip) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
77 self.assertEqual(tip.parents()[0].node(), expected_parent) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
78 self.assertEqual(tip['adding_file'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
79 self.assertEqual(tip.branch(), 'default') |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
80 |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
81 |
82
71de43e9f614
Extract PushTest common code into test_util.TestBase
Patrick Mezard <pmezard@gmail.com>
parents:
80
diff
changeset
|
82 class PushTests(test_util.TestBase): |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
83 def setUp(self): |
82
71de43e9f614
Extract PushTest common code into test_util.TestBase
Patrick Mezard <pmezard@gmail.com>
parents:
80
diff
changeset
|
84 test_util.TestBase.setUp(self) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
85 test_util.load_fixture_and_fetch('simple_branch.svndump', |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
86 self.repo_path, |
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
87 self.wc_path) |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
88 |
220
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
89 def test_cant_push_empty_ctx(self): |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
90 repo = self.repo |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
91 def file_callback(repo, memctx, path): |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
92 if path == 'adding_file': |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
93 return context.memfilectx(path=path, |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
94 data='foo', |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
95 islink=False, |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
96 isexec=False, |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
97 copied=False) |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
98 raise IOError() |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
99 ctx = context.memctx(repo, |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
100 (repo['default'].node(), node.nullid), |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
101 'automated test', |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
102 [], |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
103 file_callback, |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
104 'an_author', |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
105 '2008-10-07 20:59:48 -0500', |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
106 {'branch': 'default',}) |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
107 new_hash = repo.commitctx(ctx) |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
108 hg.update(repo, repo['tip'].node()) |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
109 old_tip = repo['tip'].node() |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
110 self.pushrevisions() |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
111 tip = self.repo['tip'] |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
112 self.assertEqual(tip.node(), old_tip) |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
113 |
06eb60f9a026
push: Do not attempt to push empty revisions.
Augie Fackler <durin42@gmail.com>
parents:
150
diff
changeset
|
114 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
115 def test_push_to_default(self, commit=True): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
116 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
117 old_tip = repo['tip'].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
118 expected_parent = repo['default'].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
119 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
120 if path == 'adding_file': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
121 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
122 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
123 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
124 isexec=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
125 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
126 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
127 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
128 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
129 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
130 ['adding_file'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
131 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
132 'an_author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
133 '2008-10-07 20:59:48 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
134 {'branch': 'default',}) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
135 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
136 if not commit: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
137 return # some tests use this test as an extended setup. |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
138 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
139 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
140 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
141 self.assertNotEqual(tip.node(), old_tip) |
150
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
142 self.assertEqual(node.hex(tip.parents()[0].node()), |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
143 node.hex(expected_parent)) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
144 self.assertEqual(tip['adding_file'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
145 self.assertEqual(tip.branch(), 'default') |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
146 |
150
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
147 def test_push_two_revs_different_local_branch(self): |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
148 def filectxfn(repo, memctx, path): |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
149 return context.memfilectx(path=path, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
150 data=path, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
151 islink=False, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
152 isexec=False, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
153 copied=False) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
154 oldtiphash = self.repo['default'].node() |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
155 ctx = context.memctx(self.repo, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
156 (self.repo[0].node(), revlog.nullid, ), |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
157 'automated test', |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
158 ['gamma', ], |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
159 filectxfn, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
160 'testy', |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
161 '2008-12-21 16:32:00 -0500', |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
162 {'branch': 'localbranch', }) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
163 newhash = self.repo.commitctx(ctx) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
164 ctx = context.memctx(self.repo, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
165 (newhash, revlog.nullid), |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
166 'automated test2', |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
167 ['delta', ], |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
168 filectxfn, |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
169 'testy', |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
170 '2008-12-21 16:32:00 -0500', |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
171 {'branch': 'localbranch', }) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
172 newhash = self.repo.commitctx(ctx) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
173 repo = self.repo |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
174 hg.update(repo, newhash) |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
175 wrappers.push(None, ui.ui(), repo=repo) |
150
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
176 self.assertEqual(self.repo['tip'].parents()[0].parents()[0].node(), oldtiphash) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
177 self.assertEqual(self.repo['tip'].files(), ['delta', ]) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
178 self.assertEqual(self.repo['tip'].manifest().keys(), |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
179 ['alpha', 'beta', 'gamma', 'delta']) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
180 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
181 def test_push_two_revs(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
182 # set up some work for us |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
183 self.test_push_to_default(commit=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
184 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
185 old_tip = repo['tip'].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
186 expected_parent = repo['tip'].parents()[0].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
187 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
188 if path == 'adding_file2': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
189 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
190 data='foo2', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
191 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
192 isexec=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
193 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
194 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
195 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
196 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
197 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
198 ['adding_file2'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
199 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
200 'an_author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
201 '2008-10-07 20:59:48 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
202 {'branch': 'default',}) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
203 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
204 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
205 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
206 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
207 self.assertNotEqual(tip.node(), old_tip) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
208 self.assertNotEqual(tip.parents()[0].node(), old_tip) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
209 self.assertEqual(tip.parents()[0].parents()[0].node(), expected_parent) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
210 self.assertEqual(tip['adding_file2'].data(), 'foo2') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
211 self.assertEqual(tip['adding_file'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
212 self.assertEqual(tip.parents()[0]['adding_file'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
213 try: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
214 self.assertEqual(tip.parents()[0]['adding_file2'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
215 assert False, "this is impossible, adding_file2 should not be in this manifest." |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
216 except revlog.LookupError, e: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
217 pass |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
218 self.assertEqual(tip.branch(), 'default') |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
219 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
220 def test_push_to_branch(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
221 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
222 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
223 if path == 'adding_file': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
224 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
225 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
226 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
227 isexec=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
228 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
229 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
230 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
231 (repo['the_branch'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
232 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
233 ['adding_file'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
234 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
235 'an_author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
236 '2008-10-07 20:59:48 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
237 {'branch': 'the_branch',}) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
238 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
239 #commands.update(ui.ui(), self.repo, node='tip') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
240 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
241 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
242 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
243 self.assertNotEqual(tip.node(), new_hash) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
244 self.assertEqual(tip['adding_file'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
245 self.assertEqual(tip.branch(), 'the_branch') |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
246 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
247 def test_delete_file(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
248 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
249 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
250 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
251 old_files = set(repo['default'].manifest().keys()) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
252 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
253 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
254 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
255 ['alpha'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
256 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
257 'an author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
258 '2008-10-29 21:26:00 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
259 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
260 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
261 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
262 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
263 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
264 self.assertEqual(old_files, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
265 set(tip.manifest().keys() + ['alpha'])) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
266 self.assert_('alpha' not in tip.manifest()) |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
267 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
268 def test_push_executable_file(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
269 self.test_push_to_default(commit=True) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
270 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
271 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
272 if path == 'gamma': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
273 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
274 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
275 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
276 isexec=True, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
277 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
278 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
279 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
280 (repo['tip'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
281 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
282 ['gamma', ], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
283 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
284 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
285 '2008-10-29 21:26:00 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
286 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
287 new_hash = repo.commitctx(ctx) |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
288 hg.clean(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
289 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
290 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
291 self.assertNotEqual(tip.node(), new_hash) |
257
ffccf0080e54
Move wrappers for hg commands to their own module.
Augie Fackler <durin42@gmail.com>
parents:
242
diff
changeset
|
292 self.assert_('@' in self.repo['tip'].user()) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
293 self.assertEqual(tip['gamma'].flags(), 'x') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
294 self.assertEqual(tip['gamma'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
295 self.assertEqual([x for x in tip.manifest().keys() if 'x' not in |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
296 tip[x].flags()], ['alpha', 'beta', 'adding_file', ]) |
49
2bc4999a89d3
Add tests for a bunch more cases in pushing to svn.
Augie Fackler <durin42@gmail.com>
parents:
48
diff
changeset
|
297 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
298 def test_push_symlink_file(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
299 self.test_push_to_default(commit=True) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
300 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
301 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
302 if path == 'gamma': |
49
2bc4999a89d3
Add tests for a bunch more cases in pushing to svn.
Augie Fackler <durin42@gmail.com>
parents:
48
diff
changeset
|
303 return context.memfilectx(path=path, |
2bc4999a89d3
Add tests for a bunch more cases in pushing to svn.
Augie Fackler <durin42@gmail.com>
parents:
48
diff
changeset
|
304 data='foo', |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
305 islink=True, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
306 isexec=False, |
49
2bc4999a89d3
Add tests for a bunch more cases in pushing to svn.
Augie Fackler <durin42@gmail.com>
parents:
48
diff
changeset
|
307 copied=False) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
308 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
309 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
310 (repo['tip'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
311 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
312 ['gamma', ], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
313 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
314 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
315 '2008-10-29 21:26:00 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
316 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
317 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
318 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
319 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
320 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
321 self.assertNotEqual(tip.node(), new_hash) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
322 self.assertEqual(tip['gamma'].flags(), 'l') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
323 self.assertEqual(tip['gamma'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
324 self.assertEqual([x for x in tip.manifest().keys() if 'l' not in |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
325 tip[x].flags()], ['alpha', 'beta', 'adding_file', ]) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
326 |
60
41dc00c7aef1
Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt.
Augie Fackler <durin42@gmail.com>
parents:
50
diff
changeset
|
327 def test_push_existing_file_newly_symlink(self): |
41dc00c7aef1
Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt.
Augie Fackler <durin42@gmail.com>
parents:
50
diff
changeset
|
328 self.test_push_existing_file_newly_execute(execute=False, |
41dc00c7aef1
Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt.
Augie Fackler <durin42@gmail.com>
parents:
50
diff
changeset
|
329 link=True, |
41dc00c7aef1
Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt.
Augie Fackler <durin42@gmail.com>
parents:
50
diff
changeset
|
330 expected_flags='l') |
41dc00c7aef1
Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt.
Augie Fackler <durin42@gmail.com>
parents:
50
diff
changeset
|
331 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
332 def test_push_existing_file_newly_execute(self, execute=True, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
333 link=False, expected_flags='x'): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
334 self.test_push_to_default() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
335 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
336 def file_callback(repo, memctx, path): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
337 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
338 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
339 islink=link, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
340 isexec=execute, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
341 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
342 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
343 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
344 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
345 ['alpha', ], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
346 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
347 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
348 '2008-1-1 00:00:00 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
349 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
350 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
351 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
352 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
353 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
354 self.assertNotEqual(tip.node(), new_hash) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
355 self.assertEqual(tip['alpha'].data(), 'foo') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
356 self.assertEqual(tip.parents()[0]['alpha'].flags(), '') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
357 self.assertEqual(tip['alpha'].flags(), expected_flags) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
358 # while we're here, double check pushing an already-executable file |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
359 # works |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
360 repo = self.repo |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
361 def file_callback2(repo, memctx, path): |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
362 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
363 data='bar', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
364 islink=link, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
365 isexec=execute, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
366 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
367 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
368 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
369 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
370 ['alpha', ], |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
371 file_callback2, |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
372 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
373 '2008-1-1 00:00:00 -0500', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
374 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
375 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
376 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
377 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
378 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
379 self.assertNotEqual(tip.node(), new_hash) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
380 self.assertEqual(tip['alpha'].data(), 'bar') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
381 self.assertEqual(tip.parents()[0]['alpha'].flags(), expected_flags) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
382 self.assertEqual(tip['alpha'].flags(), expected_flags) |
62
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
383 # now test removing the property entirely |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
384 repo = self.repo |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
385 def file_callback3(repo, memctx, path): |
62
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
386 return context.memfilectx(path=path, |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
387 data='bar', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
388 islink=False, |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
389 isexec=False, |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
390 copied=False) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
391 ctx = context.memctx(repo, |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
392 (repo['default'].node(), node.nullid), |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
393 'message', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
394 ['alpha', ], |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
395 file_callback3, |
62
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
396 'author', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
397 '2008-01-01 00:00:00 -0500', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
398 {'branch': 'default', }) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
399 new_hash = repo.commitctx(ctx) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
400 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
401 self.pushrevisions() |
62
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
402 tip = self.repo['tip'] |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
403 self.assertNotEqual(tip.node(), new_hash) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
404 self.assertEqual(tip['alpha'].data(), 'bar') |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
405 self.assertEqual(tip.parents()[0]['alpha'].flags(), expected_flags) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
406 self.assertEqual(tip['alpha'].flags(), '') |
49
2bc4999a89d3
Add tests for a bunch more cases in pushing to svn.
Augie Fackler <durin42@gmail.com>
parents:
48
diff
changeset
|
407 |
277
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
408 def test_push_outdated_base_text(self): |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
409 self.test_push_two_revs() |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
410 changes = [('adding_file', 'adding_file', 'different_content', ), |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
411 ] |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
412 self.commitchanges(changes, parent='tip') |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
413 self.pushrevisions() |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
414 changes = [('adding_file', 'adding_file', |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
415 'even_more different_content', ), |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
416 ] |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
417 self.commitchanges(changes, parent=3) |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
418 try: |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
419 self.pushrevisions() |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
420 assert False, 'This should have aborted!' |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
421 except hgutil.Abort, e: |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
422 self.assertEqual(e.args[0], |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
423 'Base text was out of date, maybe rebase?') |
3848a7f9b983
push: Add a test that demonstrates base-text detection works
Augie Fackler <durin42@gmail.com>
parents:
257
diff
changeset
|
424 |
16
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
425 |
48a44546c12f
Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
426 def suite(): |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
427 test_classes = [PushTests, PushOverSvnserveTests] |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
428 tests = [] |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
429 # This is the quickest hack I could come up with to load all the tests from |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
430 # both classes. Would love a patch that simplifies this without adding |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
431 # dependencies. |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
432 for tc in test_classes: |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
433 for attr in dir(tc): |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
434 if attr.startswith('test_'): |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
435 tests.append(tc(attr)) |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
436 return unittest.TestSuite(tests) |