Ticket #1548: 1548-fix-missing-rename.darcs.patch

File 1548-fix-missing-rename.darcs.patch, 7.6 KB (added by davidsarah, at 2011-09-27T22:09:17Z)

test/test_upload.py: fix a missing rename of client to clientandserver. refs #1548 (Includes previous patch.)

Line 
12 patches for repository http://tahoe-lafs.org/source/tahoe/trunk:
2
3Tue Sep 27 20:30:28 BST 2011  zooko@zooko.com
4  * Rename allmydata.client.Client to allmydata.clientandserver.ClientAndServer.
5  Create a tiny shim allmydata.client.Client whose only purpose in life is to be available for the .tac files to invoke. (See the docstring of the new allmydata.client.Client for details.)
6  Regularize some of the names of directories created by unit tests.
7
8Tue Sep 27 23:06:35 BST 2011  david-sarah@jacaranda.org
9  * test/test_upload.py: fix a missing rename of client to clientandserver. refs #1548
10
11New patches:
12
13[Rename allmydata.client.Client to allmydata.clientandserver.ClientAndServer.
14zooko@zooko.com**20110927193028
15 Ignore-this: b5bd4ae4522751d567858a19bf9a4e17
16 Create a tiny shim allmydata.client.Client whose only purpose in life is to be available for the .tac files to invoke. (See the docstring of the new allmydata.client.Client for details.)
17 Regularize some of the names of directories created by unit tests.
18] {
19move ./src/allmydata/client.py ./src/allmydata/clientandserver.py
20move ./src/allmydata/test/test_client.py ./src/allmydata/test/test_clientandserver.py
21addfile ./src/allmydata/client.py
22hunk ./src/allmydata/client.py 1
23+from allmydata import clientandserver
24+
25+def Client(basedir="."):
26+    """
27+    This is the entry point to Tahoe-LAFS code. It gets executed by the .tac
28+    files which are produced by "tahoe create-client", "tahoe
29+    create-introducer", and "tahoe create-node", and it gets executed by
30+    windows/tahoesvc.py.
31+
32+    The name 'Client' is not a good name for this, but we can't change it
33+    unless we change the .tac files that have previously been produced and
34+    written to users' filesystems, or stop using .tac files (see ticket
35+    #1159).
36+
37+    The reason it isn't a good name is that this same entry point also
38+    launches servers.
39+    """
40+    return clientandserver.ClientAndServer(basedir)
41replace ./src/allmydata/clientandserver.py [A-Za-z_0-9] Client ClientAndServer
42replace ./src/allmydata/immutable/upload.py [A-Za-z_0-9] Client ClientAndServer
43replace ./src/allmydata/node.py [A-Za-z_0-9] Client ClientAndServer
44replace ./src/allmydata/storage_client.py [A-Za-z_0-9] Client ClientAndServer
45hunk ./src/allmydata/test/check_memory.py 8
46 from twisted.internet import defer, reactor, protocol, error
47 from twisted.application import service, internet
48 from twisted.web import client as tw_client
49-from allmydata import client, introducer
50+from allmydata import clientandserver, introducer
51 from allmydata.immutable import upload
52 from allmydata.scripts import create_node
53 from allmydata.util import fileutil, pollmixin
54replace ./src/allmydata/test/check_memory.py [A-Za-z_0-9\-\.] client.Client clientandserver.ClientAndServer
55hunk ./src/allmydata/test/common.py 9
56 from twisted.application import service
57 from twisted.web.error import Error as WebError
58 from foolscap.api import flushEventualQueue, fireEventually
59-from allmydata import uri, dirnode, client
60+from allmydata import uri, dirnode, clientandserver
61 from allmydata.introducer.server import IntroducerNode
62 from allmydata.interfaces import IMutableFileNode, IImmutableFileNode,\
63                                  NotEnoughSharesError, ICheckable, \
64replace ./src/allmydata/test/common.py [A-Za-z_0-9\-\.] client.Client clientandserver.ClientAndServer
65replace ./src/allmydata/test/no_network.py [A-Za-z_0-9\-\.] allmydata.client allmydata.clientandserver
66replace ./src/allmydata/test/no_network.py [A-Za-z_0-9] Client ClientAndServer
67hunk ./src/allmydata/test/test_clientandserver.py 7
68 
69 import allmydata
70 from allmydata.node import OldConfigError
71-from allmydata import client
72+from allmydata import clientandserver
73 from allmydata.storage_client import StorageFarmBroker
74 from allmydata.util import base32, fileutil
75 from allmydata.interfaces import IFilesystemNode, IFileNode, \
76hunk ./src/allmydata/test/test_clientandserver.py 295
77 
78 class NodeMaker(testutil.ReallyEqualMixin, unittest.TestCase):
79     def test_maker(self):
80-        basedir = "client/NodeMaker/maker"
81+        basedir = "test_client/NodeMaker/test_maker"
82         fileutil.make_dirs(basedir)
83         fileutil.write(os.path.join(basedir, "tahoe.cfg"), BASECONFIG)
84         c = client.Client(basedir)
85replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Client clientandserver.ClientAndServer
86replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9] test_client test_clientandserver
87replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_1 test_clientandserver.Basic.test_reserved_1
88replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_2 test_clientandserver.Basic.test_reserved_2
89replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_3 test_clientandserver.Basic.test_reserved_3
90replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_4 test_clientandserver.Basic.test_reserved_4
91replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_bad test_clientandserver.Basic.test_reserved_bad
92replace ./src/allmydata/test/test_dirnode.py [A-Za-z_0-9\-\.] allmydata.client allmydata.clientandserver
93replace ./src/allmydata/test/test_dirnode.py [A-Za-z_0-9] Client ClientAndServer
94hunk ./src/allmydata/test/test_filenode.py 3
95 
96 from twisted.trial import unittest
97-from allmydata import uri, client
98+from allmydata import uri, clientandserver
99 from allmydata.monitor import Monitor
100 from allmydata.immutable.literal import LiteralFileNode
101 from allmydata.immutable.filenode import ImmutableFileNode
102hunk ./src/allmydata/test/test_filenode.py 25
103         return None
104     def get_history(self):
105         return None
106-    _secret_holder = client.SecretHolder("lease secret", "convergence secret")
107+    _secret_holder = clientandserver.SecretHolder("lease secret", "convergence secret")
108 
109 class Node(unittest.TestCase):
110     def test_chk_filenode(self):
111replace ./src/allmydata/test/test_helper.py [A-Za-z_0-9] client clientandserver
112replace ./src/allmydata/test/test_mutable.py [A-Za-z_0-9] client clientandserver
113replace ./src/allmydata/test/test_web.py [A-Za-z_0-9] Client ClientAndServer
114replace ./src/allmydata/test/test_web.py [A-Za-z_0-9\-\.] allmydata.client allmydata.clientandserver
115}
116[test/test_upload.py: fix a missing rename of client to clientandserver. refs #1548
117david-sarah@jacaranda.org**20110927220635
118 Ignore-this: 8d6f967403548a5946de7e738769a2c1
119] {
120hunk ./src/allmydata/test/test_upload.py 11
121 from foolscap.api import fireEventually
122 
123 import allmydata # for __full_version__
124-from allmydata import uri, monitor, client
125+from allmydata import uri, monitor, clientandserver
126 from allmydata.immutable import upload, encode
127 from allmydata.interfaces import FileTooLargeError, UploadUnhappinessError
128 from allmydata.util import log
129hunk ./src/allmydata/test/test_upload.py 209
130         return self.DEFAULT_ENCODING_PARAMETERS
131     def get_storage_broker(self):
132         return self.storage_broker
133-    _secret_holder = client.SecretHolder("lease secret", "convergence secret")
134+    _secret_holder = clientandserver.SecretHolder("lease secret", "convergence secret")
135 
136 class GotTooFarError(Exception):
137     pass
138}
139
140Context:
141
142[docs/configuration.rst: add section about the types of node, and clarify when setting web.port enables web-API service. fixes #1444
143zooko@zooko.com**20110926203801
144 Ignore-this: ab94d470c68e720101a7ff3c207a719e
145]
146[TAG allmydata-tahoe-1.9.0a2
147warner@lothar.com**20110925234811
148 Ignore-this: e9649c58f9c9017a7d55008938dba64f
149]
150Patch bundle hash:
151ae38b89fe5abe19d57aa7246e283cc5e8dfe25c3