Mercurial > hgsubversion
annotate tests/test_push_command.py @ 241:4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Wed, 08 Apr 2009 17:49:30 +0200 |
parents | 06eb60f9a026 |
children | 06130689a2c8 |
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 |
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
|
11 |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
220
diff
changeset
|
12 import svncommands |
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
|
13 import push_cmd |
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) |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
220
diff
changeset
|
41 svncommands.pull(ui.ui(), svn_url='svn://localhost/', |
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
220
diff
changeset
|
42 hg_repo_path=self.wc_path) |
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()) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
72 push_cmd.push_revisions_to_subversion(ui.ui(), repo=self.repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
73 hg_repo_path=self.wc_path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
74 svn_url='svn://localhost/') |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
75 tip = self.repo['tip'] |
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) |
58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
Augie Fackler <durin42@gmail.com>
parents:
101
diff
changeset
|
175 push_cmd.push_revisions_to_subversion(ui.ui(), |
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 repo=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
|
177 svn_url=test_util.fileurl(self.repo_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
|
178 hg_repo_path=self.wc_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
|
179 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
|
180 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
|
181 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
|
182 ['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
|
183 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
184 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
|
185 # 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
|
186 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
|
187 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
188 old_tip = repo['tip'].node() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
189 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
|
190 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
|
191 if path == 'adding_file2': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
192 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
193 data='foo2', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
194 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
195 isexec=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
196 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
197 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
198 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
199 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
200 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
201 ['adding_file2'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
202 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
203 'an_author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
204 '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
|
205 {'branch': 'default',}) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
206 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
207 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
208 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
209 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
210 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
|
211 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
|
212 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
|
213 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
|
214 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
|
215 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
|
216 try: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
217 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
|
218 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
|
219 except revlog.LookupError, e: |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
220 pass |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
221 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
|
222 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
223 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
|
224 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
225 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
|
226 if path == 'adding_file': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
227 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
228 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
229 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
230 isexec=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
231 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
232 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
233 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
234 (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
|
235 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
236 ['adding_file'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
237 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
238 'an_author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
239 '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
|
240 {'branch': 'the_branch',}) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
241 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
242 #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
|
243 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
244 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
245 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
246 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
|
247 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
|
248 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
|
249 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
250 def test_delete_file(self): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
251 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
252 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
|
253 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
254 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
|
255 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
256 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
257 'automated test', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
258 ['alpha'], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
259 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
260 'an author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
261 '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
|
262 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
263 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
264 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
265 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
266 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
267 self.assertEqual(old_files, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
268 set(tip.manifest().keys() + ['alpha'])) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
269 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
|
270 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
271 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
|
272 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
|
273 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
274 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
|
275 if path == 'gamma': |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
276 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
277 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
278 islink=False, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
279 isexec=True, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
280 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
281 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
282 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
283 (repo['tip'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
284 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
285 ['gamma', ], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
286 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
287 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
288 '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
|
289 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
290 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
291 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
292 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
293 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
294 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
|
295 self.assert_('@' in tip.user()) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
296 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
|
297 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
|
298 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
|
299 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
|
300 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
301 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
|
302 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
|
303 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
304 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
|
305 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
|
306 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
|
307 data='foo', |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
308 islink=True, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
309 isexec=False, |
49
2bc4999a89d3
Add tests for a bunch more cases in pushing to svn.
Augie Fackler <durin42@gmail.com>
parents:
48
diff
changeset
|
310 copied=False) |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
311 raise IOError() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
312 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
313 (repo['tip'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
314 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
315 ['gamma', ], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
316 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
317 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
318 '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
|
319 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
320 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
321 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
322 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
323 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
324 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
|
325 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
|
326 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
|
327 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
|
328 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
|
329 |
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
|
330 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
|
331 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
|
332 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
|
333 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
|
334 |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
335 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
|
336 link=False, expected_flags='x'): |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
337 self.test_push_to_default() |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
338 repo = self.repo |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
339 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
|
340 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
341 data='foo', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
342 islink=link, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
343 isexec=execute, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
344 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
345 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
346 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
347 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
348 ['alpha', ], |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
349 file_callback, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
350 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
351 '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
|
352 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
353 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
354 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
355 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
356 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
357 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
|
358 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
|
359 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
|
360 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
|
361 # 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
|
362 # works |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
363 repo = self.repo |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
364 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
|
365 return context.memfilectx(path=path, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
366 data='bar', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
367 islink=link, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
368 isexec=execute, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
369 copied=False) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
370 ctx = context.memctx(repo, |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
371 (repo['default'].node(), node.nullid), |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
372 'message', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
373 ['alpha', ], |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
374 file_callback2, |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
375 'author', |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
376 '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
|
377 {'branch': 'default', }) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
378 new_hash = repo.commitctx(ctx) |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
379 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
380 self.pushrevisions() |
50
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
381 tip = self.repo['tip'] |
80b923ab242b
Drop any pretense of supporting svn 1.4.x.
Augie Fackler <durin42@gmail.com>
parents:
49
diff
changeset
|
382 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
|
383 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
|
384 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
|
385 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
|
386 # 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
|
387 repo = self.repo |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
388 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
|
389 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
|
390 data='bar', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
391 islink=False, |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
392 isexec=False, |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
393 copied=False) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
394 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
|
395 (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
|
396 'message', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
397 ['alpha', ], |
101
a3b717e4abf5
Cleanups based on pyflakes output.
Augie Fackler <durin42@gmail.com>
parents:
83
diff
changeset
|
398 file_callback3, |
62
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
399 'author', |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
400 '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
|
401 {'branch': 'default', }) |
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
402 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
|
403 hg.update(repo, repo['tip'].node()) |
78
072010a271c6
Fix basic issues with tests on Windows
Patrick Mezard <pmezard@gmail.com>
parents:
65
diff
changeset
|
404 self.pushrevisions() |
62
cc5ebdb1e8d4
push_cmd: Further simplified some logic thanks to an improved test.
Augie Fackler <durin42@gmail.com>
parents:
60
diff
changeset
|
405 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
|
406 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
|
407 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
|
408 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
|
409 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
|
410 |
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
|
411 |
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
|
412 def suite(): |
48
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
413 test_classes = [PushTests, PushOverSvnserveTests] |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
414 tests = [] |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
415 # 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
|
416 # 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
|
417 # dependencies. |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
418 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
|
419 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
|
420 if attr.startswith('test_'): |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
421 tests.append(tc(attr)) |
d87b57c719f0
Add a test that verifies push works to svn:// servers.
Augie Fackler <durin42@gmail.com>
parents:
27
diff
changeset
|
422 return unittest.TestSuite(tests) |