Merge lp:~cjwatson/launchpad/always-https-codebrowse into lp:launchpad
- always-https-codebrowse
- Merge into devel
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 18539 |
Proposed branch: | lp:~cjwatson/launchpad/always-https-codebrowse |
Merge into: | lp:launchpad |
Diff against target: |
306 lines (+33/-44) 8 files modified
configs/development/launchpad-lazr.conf (+0/-1) lib/launchpad_loggerhead/tests.py (+4/-12) lib/lp/code/model/branch.py (+2/-5) lib/lp/code/model/tests/test_branch.py (+5/-5) lib/lp/code/stories/branches/xx-branch-index.txt (+2/-2) lib/lp/registry/stories/product/xx-product-code-trunk.txt (+3/-3) lib/lp/services/config/schema-lazr.conf (+7/-7) utilities/community-contributions.py (+10/-9) |
To merge this branch: | bzr merge lp:~cjwatson/launchpad/always-https-codebrowse |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+336376@code.launchpad.net |
Commit message
Construct all links to Bazaar codebrowse using HTTPS.
Description of the change
Especially relevant since bazaar.
To post a comment you must log in.
Revision history for this message
William Grant (wgrant) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'configs/development/launchpad-lazr.conf' | |||
2 | --- configs/development/launchpad-lazr.conf 2017-09-07 13:25:13 +0000 | |||
3 | +++ configs/development/launchpad-lazr.conf 2018-01-19 17:32:19 +0000 | |||
4 | @@ -36,7 +36,6 @@ | |||
5 | 36 | authentication_endpoint: http://xmlrpc-private.launchpad.dev:8087/authserver | 36 | authentication_endpoint: http://xmlrpc-private.launchpad.dev:8087/authserver |
6 | 37 | codehosting_endpoint: http://xmlrpc-private.launchpad.dev:8087/codehosting | 37 | codehosting_endpoint: http://xmlrpc-private.launchpad.dev:8087/codehosting |
7 | 38 | supermirror_root: http://bazaar.launchpad.dev/ | 38 | supermirror_root: http://bazaar.launchpad.dev/ |
8 | 39 | codebrowse_root: http://bazaar.launchpad.dev/ | ||
9 | 40 | secure_codebrowse_root: https://bazaar.launchpad.dev/ | 39 | secure_codebrowse_root: https://bazaar.launchpad.dev/ |
10 | 41 | internal_branch_by_id_root: http://bazaar-internal.launchpad.dev/ | 40 | internal_branch_by_id_root: http://bazaar-internal.launchpad.dev/ |
11 | 42 | internal_codebrowse_root: http://localhost:8080/ | 41 | internal_codebrowse_root: http://localhost:8080/ |
12 | 43 | 42 | ||
13 | === modified file 'lib/launchpad_loggerhead/tests.py' | |||
14 | --- lib/launchpad_loggerhead/tests.py 2018-01-02 10:54:31 +0000 | |||
15 | +++ lib/launchpad_loggerhead/tests.py 2018-01-19 17:32:19 +0000 | |||
16 | @@ -1,15 +1,9 @@ | |||
18 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2018 Canonical Ltd. This software is licensed under the |
19 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
20 | 3 | 3 | ||
21 | 4 | import cStringIO | ||
22 | 5 | import errno | ||
23 | 6 | import logging | ||
24 | 7 | import re | ||
25 | 8 | import socket | ||
26 | 9 | import urllib | 4 | import urllib |
27 | 10 | 5 | ||
28 | 11 | import lazr.uri | 6 | import lazr.uri |
29 | 12 | from paste import httpserver | ||
30 | 13 | from paste.httpexceptions import HTTPExceptionHandler | 7 | from paste.httpexceptions import HTTPExceptionHandler |
31 | 14 | import wsgi_intercept | 8 | import wsgi_intercept |
32 | 15 | from wsgi_intercept.urllib2_intercept import ( | 9 | from wsgi_intercept.urllib2_intercept import ( |
33 | @@ -17,7 +11,6 @@ | |||
34 | 17 | uninstall_opener, | 11 | uninstall_opener, |
35 | 18 | ) | 12 | ) |
36 | 19 | import wsgi_intercept.zope_testbrowser | 13 | import wsgi_intercept.zope_testbrowser |
37 | 20 | import zope.event | ||
38 | 21 | 14 | ||
39 | 22 | from launchpad_loggerhead.app import RootApp | 15 | from launchpad_loggerhead.app import RootApp |
40 | 23 | from launchpad_loggerhead.session import SessionHandler | 16 | from launchpad_loggerhead.session import SessionHandler |
41 | @@ -37,14 +30,14 @@ | |||
42 | 37 | def session_scribbler(app, test): | 30 | def session_scribbler(app, test): |
43 | 38 | """Squirrel away the session variable.""" | 31 | """Squirrel away the session variable.""" |
44 | 39 | def scribble(environ, start_response): | 32 | def scribble(environ, start_response): |
46 | 40 | test.session = environ[SESSION_VAR] # Yay for mutables. | 33 | test.session = environ[SESSION_VAR] # Yay for mutables. |
47 | 41 | return app(environ, start_response) | 34 | return app(environ, start_response) |
48 | 42 | return scribble | 35 | return scribble |
49 | 43 | 36 | ||
50 | 44 | 37 | ||
51 | 45 | def dummy_destination(environ, start_response): | 38 | def dummy_destination(environ, start_response): |
52 | 46 | """Return a fake response.""" | 39 | """Return a fake response.""" |
54 | 47 | start_response('200 OK', [('Content-type','text/plain')]) | 40 | start_response('200 OK', [('Content-type', 'text/plain')]) |
55 | 48 | return ['This is a dummy destination.\n'] | 41 | return ['This is a dummy destination.\n'] |
56 | 49 | 42 | ||
57 | 50 | 43 | ||
58 | @@ -52,7 +45,7 @@ | |||
59 | 52 | """A mock root app that doesn't require open id.""" | 45 | """A mock root app that doesn't require open id.""" |
60 | 53 | def _complete_login(self, environ, start_response): | 46 | def _complete_login(self, environ, start_response): |
61 | 54 | environ[SESSION_VAR]['user'] = 'bob' | 47 | environ[SESSION_VAR]['user'] = 'bob' |
63 | 55 | start_response('200 OK', [('Content-type','text/plain')]) | 48 | start_response('200 OK', [('Content-type', 'text/plain')]) |
64 | 56 | return ['\n'] | 49 | return ['\n'] |
65 | 57 | 50 | ||
66 | 58 | 51 | ||
67 | @@ -85,7 +78,6 @@ | |||
68 | 85 | app = HTTPExceptionHandler(app) | 78 | app = HTTPExceptionHandler(app) |
69 | 86 | app = SessionHandler(app, SESSION_VAR, SECRET) | 79 | app = SessionHandler(app, SESSION_VAR, SECRET) |
70 | 87 | self.cookie_name = app.cookie_handler.cookie_name | 80 | self.cookie_name = app.cookie_handler.cookie_name |
71 | 88 | self.intercept(config.codehosting.codebrowse_root, app) | ||
72 | 89 | self.intercept(config.codehosting.secure_codebrowse_root, app) | 81 | self.intercept(config.codehosting.secure_codebrowse_root, app) |
73 | 90 | self.intercept(allvhosts.configs['mainsite'].rooturl, | 82 | self.intercept(allvhosts.configs['mainsite'].rooturl, |
74 | 91 | dummy_destination) | 83 | dummy_destination) |
75 | 92 | 84 | ||
76 | === modified file 'lib/lp/code/model/branch.py' | |||
77 | --- lib/lp/code/model/branch.py 2017-11-24 17:22:34 +0000 | |||
78 | +++ lib/lp/code/model/branch.py 2018-01-19 17:32:19 +0000 | |||
79 | @@ -1,4 +1,4 @@ | |||
81 | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the |
82 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
83 | 3 | 3 | ||
84 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
85 | @@ -699,10 +699,7 @@ | |||
86 | 699 | 699 | ||
87 | 700 | def getCodebrowseUrl(self, *extras): | 700 | def getCodebrowseUrl(self, *extras): |
88 | 701 | """See `IBranch`.""" | 701 | """See `IBranch`.""" |
93 | 702 | if self.private: | 702 | root = config.codehosting.secure_codebrowse_root |
90 | 703 | root = config.codehosting.secure_codebrowse_root | ||
91 | 704 | else: | ||
92 | 705 | root = config.codehosting.codebrowse_root | ||
94 | 706 | return urlutils.join(root, self.unique_name, *extras) | 703 | return urlutils.join(root, self.unique_name, *extras) |
95 | 707 | 704 | ||
96 | 708 | def getCodebrowseUrlForRevision(self, revision): | 705 | def getCodebrowseUrlForRevision(self, revision): |
97 | 709 | 706 | ||
98 | === modified file 'lib/lp/code/model/tests/test_branch.py' | |||
99 | --- lib/lp/code/model/tests/test_branch.py 2018-01-02 16:10:26 +0000 | |||
100 | +++ lib/lp/code/model/tests/test_branch.py 2018-01-19 17:32:19 +0000 | |||
101 | @@ -1,4 +1,4 @@ | |||
103 | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the |
104 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
105 | 3 | 3 | ||
106 | 4 | """Tests for Branches.""" | 4 | """Tests for Branches.""" |
107 | @@ -2281,14 +2281,14 @@ | |||
108 | 2281 | layer = DatabaseFunctionalLayer | 2281 | layer = DatabaseFunctionalLayer |
109 | 2282 | 2282 | ||
110 | 2283 | def test_simple(self): | 2283 | def test_simple(self): |
112 | 2284 | # The basic codebrowse URL for a public branch is a 'http' url. | 2284 | # The basic codebrowse URL for a public branch is an 'https' URL. |
113 | 2285 | branch = self.factory.makeAnyBranch() | 2285 | branch = self.factory.makeAnyBranch() |
114 | 2286 | self.assertEqual( | 2286 | self.assertEqual( |
116 | 2287 | 'http://bazaar.launchpad.dev/' + branch.unique_name, | 2287 | 'https://bazaar.launchpad.dev/' + branch.unique_name, |
117 | 2288 | branch.getCodebrowseUrl()) | 2288 | branch.getCodebrowseUrl()) |
118 | 2289 | 2289 | ||
119 | 2290 | def test_private(self): | 2290 | def test_private(self): |
121 | 2291 | # The codebrowse URL for a private branch is a 'https' url. | 2291 | # The codebrowse URL for a private branch is an 'https' URL. |
122 | 2292 | owner = self.factory.makePerson() | 2292 | owner = self.factory.makePerson() |
123 | 2293 | branch = self.factory.makeAnyBranch( | 2293 | branch = self.factory.makeAnyBranch( |
124 | 2294 | owner=owner, information_type=InformationType.USERDATA) | 2294 | owner=owner, information_type=InformationType.USERDATA) |
125 | @@ -2301,7 +2301,7 @@ | |||
126 | 2301 | # Any arguments to getCodebrowseUrl are appended to the URL. | 2301 | # Any arguments to getCodebrowseUrl are appended to the URL. |
127 | 2302 | branch = self.factory.makeAnyBranch() | 2302 | branch = self.factory.makeAnyBranch() |
128 | 2303 | self.assertEqual( | 2303 | self.assertEqual( |
130 | 2304 | 'http://bazaar.launchpad.dev/' + branch.unique_name + '/a/b', | 2304 | 'https://bazaar.launchpad.dev/' + branch.unique_name + '/a/b', |
131 | 2305 | branch.getCodebrowseUrl('a', 'b')) | 2305 | branch.getCodebrowseUrl('a', 'b')) |
132 | 2306 | 2306 | ||
133 | 2307 | def test_source_code_url(self): | 2307 | def test_source_code_url(self): |
134 | 2308 | 2308 | ||
135 | === modified file 'lib/lp/code/stories/branches/xx-branch-index.txt' | |||
136 | --- lib/lp/code/stories/branches/xx-branch-index.txt 2015-06-27 04:10:49 +0000 | |||
137 | +++ lib/lp/code/stories/branches/xx-branch-index.txt 2018-01-19 17:32:19 +0000 | |||
138 | @@ -90,7 +90,7 @@ | |||
139 | 90 | >>> revision = find_tags_by_class( | 90 | >>> revision = find_tags_by_class( |
140 | 91 | ... user_browser.contents, 'revision-details', only_first=True) | 91 | ... user_browser.contents, 'revision-details', only_first=True) |
141 | 92 | >>> print revision.a | 92 | >>> print revision.a |
143 | 93 | <a href="http://bazaar.launchpad.dev/~eric/fooix/trunk/revision/5">5</a> | 93 | <a href="https://bazaar.launchpad.dev/~eric/fooix/trunk/revision/5">5</a> |
144 | 94 | 94 | ||
145 | 95 | 95 | ||
146 | 96 | Commit messages | 96 | Commit messages |
147 | @@ -302,7 +302,7 @@ | |||
148 | 302 | >>> browser.open( | 302 | >>> browser.open( |
149 | 303 | ... 'http://code.launchpad.dev/~name12/+junk/junk.dev') | 303 | ... 'http://code.launchpad.dev/~name12/+junk/junk.dev') |
150 | 304 | >>> print browser.getLink('All revisions').url | 304 | >>> print browser.getLink('All revisions').url |
152 | 305 | http://bazaar.launchpad.dev/~name12/+junk/junk.dev/changes | 305 | https://bazaar.launchpad.dev/~name12/+junk/junk.dev/changes |
153 | 306 | 306 | ||
154 | 307 | If the branch is private, the browse code link is not shown. In order to | 307 | If the branch is private, the browse code link is not shown. In order to |
155 | 308 | see the private branch, we need to log in as a user that is able to see | 308 | see the private branch, we need to log in as a user that is able to see |
156 | 309 | 309 | ||
157 | === modified file 'lib/lp/registry/stories/product/xx-product-code-trunk.txt' | |||
158 | --- lib/lp/registry/stories/product/xx-product-code-trunk.txt 2016-09-19 11:47:33 +0000 | |||
159 | +++ lib/lp/registry/stories/product/xx-product-code-trunk.txt 2018-01-19 17:32:19 +0000 | |||
160 | @@ -119,7 +119,7 @@ | |||
161 | 119 | Configure code for this project | 119 | Configure code for this project |
162 | 120 | (http://launchpad.dev/fooix/+configure-code) | 120 | (http://launchpad.dev/fooix/+configure-code) |
163 | 121 | Browse the code | 121 | Browse the code |
165 | 122 | (http://bazaar.launchpad.dev/~eric/fooix/trunk/files) | 122 | (https://bazaar.launchpad.dev/~eric/fooix/trunk/files) |
166 | 123 | 123 | ||
167 | 124 | 124 | ||
168 | 125 | Projects with development focus branches | 125 | Projects with development focus branches |
169 | @@ -142,7 +142,7 @@ | |||
170 | 142 | Links: | 142 | Links: |
171 | 143 | lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk) | 143 | lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk) |
172 | 144 | Browse the code | 144 | Browse the code |
174 | 145 | (http://bazaar.launchpad.dev/~eric/fooix/trunk/files) | 145 | (https://bazaar.launchpad.dev/~eric/fooix/trunk/files) |
175 | 146 | 146 | ||
176 | 147 | >>> owner_browser.open('http://launchpad.dev/fooix') | 147 | >>> owner_browser.open('http://launchpad.dev/fooix') |
177 | 148 | >>> print_development_focus(owner_browser) | 148 | >>> print_development_focus(owner_browser) |
178 | @@ -159,7 +159,7 @@ | |||
179 | 159 | Configure code for this project | 159 | Configure code for this project |
180 | 160 | (http://launchpad.dev/fooix/+configure-code) | 160 | (http://launchpad.dev/fooix/+configure-code) |
181 | 161 | Browse the code | 161 | Browse the code |
183 | 162 | (http://bazaar.launchpad.dev/~eric/fooix/trunk/files) | 162 | (https://bazaar.launchpad.dev/~eric/fooix/trunk/files) |
184 | 163 | 163 | ||
185 | 164 | 164 | ||
186 | 165 | Private development focus branches | 165 | Private development focus branches |
187 | 166 | 166 | ||
188 | === modified file 'lib/lp/services/config/schema-lazr.conf' | |||
189 | --- lib/lp/services/config/schema-lazr.conf 2017-09-07 13:25:13 +0000 | |||
190 | +++ lib/lp/services/config/schema-lazr.conf 2018-01-19 17:32:19 +0000 | |||
191 | @@ -266,17 +266,17 @@ | |||
192 | 266 | # datatype: boolean | 266 | # datatype: boolean |
193 | 267 | launch: False | 267 | launch: False |
194 | 268 | 268 | ||
195 | 269 | # Obsolete URL prefix, formerly used for links to the Bazaar code browser | ||
196 | 270 | # for public branches. This can be removed once no production configs refer | ||
197 | 271 | # to it. | ||
198 | 272 | # | ||
199 | 273 | # datatype: urlbase | ||
200 | 274 | codebrowse_root: http://bazaar.launchpad.net/ | ||
201 | 275 | |||
202 | 269 | # The URL prefix for links to the Bazaar code browser. Links are | 276 | # The URL prefix for links to the Bazaar code browser. Links are |
203 | 270 | # formed by appending the branch's unique name to the root URL. | 277 | # formed by appending the branch's unique name to the root URL. |
204 | 271 | # | 278 | # |
205 | 272 | # datatype: urlbase | 279 | # datatype: urlbase |
206 | 273 | codebrowse_root: http://bazaar.launchpad.net/ | ||
207 | 274 | |||
208 | 275 | # The URL prefix for https links to the Bazaar code browser, which | ||
209 | 276 | # allows access to private branches authenticated with OpenID. Links | ||
210 | 277 | # are formed by appending the branch's unique name to the root URL. | ||
211 | 278 | # | ||
212 | 279 | # datatype: urlbase | ||
213 | 280 | secure_codebrowse_root: https://bazaar.launchpad.net/ | 280 | secure_codebrowse_root: https://bazaar.launchpad.net/ |
214 | 281 | 281 | ||
215 | 282 | 282 | ||
216 | 283 | 283 | ||
217 | === modified file 'utilities/community-contributions.py' | |||
218 | --- utilities/community-contributions.py 2016-05-03 12:25:09 +0000 | |||
219 | +++ utilities/community-contributions.py 2018-01-19 17:32:19 +0000 | |||
220 | @@ -1,7 +1,7 @@ | |||
221 | 1 | #!/usr/bin/python | 1 | #!/usr/bin/python |
222 | 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
223 | 3 | # | 3 | # |
225 | 4 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the | 4 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the |
226 | 5 | # GNU Affero General Public License version 3 (see the file LICENSE). | 5 | # GNU Affero General Public License version 3 (see the file LICENSE). |
227 | 6 | 6 | ||
228 | 7 | """Show what Launchpad community contributors have done. | 7 | """Show what Launchpad community contributors have done. |
229 | @@ -54,7 +54,7 @@ | |||
230 | 54 | sys.stderr.write("""ERROR: Unable to import from 'editmoin'. How to solve: | 54 | sys.stderr.write("""ERROR: Unable to import from 'editmoin'. How to solve: |
231 | 55 | Get editmoin.py from launchpadlib's "contrib/" directory: | 55 | Get editmoin.py from launchpadlib's "contrib/" directory: |
232 | 56 | 56 | ||
234 | 57 | http://bazaar.launchpad.net/~lazr-developers/launchpadlib/trunk/annotate/head%3A/contrib/editmoin.py | 57 | https://bazaar.launchpad.net/~lazr-developers/launchpadlib/trunk/annotate/head%3A/contrib/editmoin.py |
235 | 58 | 58 | ||
236 | 59 | (Put it in the same directory as this script and everything should work.) | 59 | (Put it in the same directory as this script and everything should work.) |
237 | 60 | """) | 60 | """) |
238 | @@ -66,7 +66,6 @@ | |||
239 | 66 | return x.encode('utf-8', 'xmlcharrefreplace') | 66 | return x.encode('utf-8', 'xmlcharrefreplace') |
240 | 67 | 67 | ||
241 | 68 | 68 | ||
242 | 69 | |||
243 | 70 | # The output contains two classes of contributors: people who don't | 69 | # The output contains two classes of contributors: people who don't |
244 | 71 | # work for Canonical at all, and people who do work for Canonical but | 70 | # work for Canonical at all, and people who do work for Canonical but |
245 | 72 | # not on the Launchpad team. | 71 | # not on the Launchpad team. |
246 | @@ -343,18 +342,18 @@ | |||
247 | 343 | else: | 342 | else: |
248 | 344 | date_str = "(NO DATE)" | 343 | date_str = "(NO DATE)" |
249 | 345 | 344 | ||
251 | 346 | rev_url_base = "http://bazaar.launchpad.net/%s/revision/" % ( | 345 | rev_url_base = "https://bazaar.launchpad.net/%s/revision/" % ( |
252 | 347 | self.branch_info.loggerhead_path) | 346 | self.branch_info.loggerhead_path) |
253 | 348 | 347 | ||
254 | 349 | # In loggerhead, you can use either a revision number or a | 348 | # In loggerhead, you can use either a revision number or a |
255 | 350 | # revision ID. In other words, these would reach the same page: | 349 | # revision ID. In other words, these would reach the same page: |
256 | 351 | # | 350 | # |
258 | 352 | # http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/\ | 351 | # https://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/\ |
259 | 353 | # revision/9202 | 352 | # revision/9202 |
260 | 354 | # | 353 | # |
261 | 355 | # -and- | 354 | # -and- |
262 | 356 | # | 355 | # |
264 | 357 | # http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/\ | 356 | # https://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/\ |
265 | 358 | # revision/launchpad@pqm.canonical.com-20090821221206-\ | 357 | # revision/launchpad@pqm.canonical.com-20090821221206-\ |
266 | 359 | # ritpv21q8w61gbpt | 358 | # ritpv21q8w61gbpt |
267 | 360 | # | 359 | # |
268 | @@ -637,11 +636,12 @@ | |||
269 | 637 | cron job running as wgrant on devpad (though if there are no new \ | 636 | cron job running as wgrant on devpad (though if there are no new \ |
270 | 638 | contributions, the page's timestamp won't change). The code that \ | 637 | contributions, the page's timestamp won't change). The code that \ |
271 | 639 | generates this page is \ | 638 | generates this page is \ |
273 | 640 | [[http://bazaar.launchpad.net/%7Elaunchpad-pqm/launchpad/devel/annotate/head%3A/utilities/community-contributions.py|utilities/community-contributions.py]] \ | 639 | [[https://bazaar.launchpad.net/%7Elaunchpad-pqm/launchpad/devel/annotate/head%3A/utilities/community-contributions.py|utilities/community-contributions.py]] \ |
274 | 641 | in the Launchpad tree.''-~ | 640 | in the Launchpad tree.''-~ |
275 | 642 | 641 | ||
276 | 643 | """ | 642 | """ |
277 | 644 | 643 | ||
278 | 644 | |||
279 | 645 | def main(): | 645 | def main(): |
280 | 646 | quiet = False | 646 | quiet = False |
281 | 647 | dry_run = False | 647 | dry_run = False |
282 | @@ -698,8 +698,7 @@ | |||
283 | 698 | # Do everything. | 698 | # Do everything. |
284 | 699 | b = Branch.open(branch_info.path) | 699 | b = Branch.open(branch_info.path) |
285 | 700 | 700 | ||
288 | 701 | logger = log.Logger(b, {'direction' : 'reverse', | 701 | logger = log.Logger(b, {'direction': 'reverse', 'levels': 0}) |
287 | 702 | 'levels' : 0, }) | ||
289 | 703 | if not quiet: | 702 | if not quiet: |
290 | 704 | print "Calculating (this may take a while)..." | 703 | print "Calculating (this may take a while)..." |
291 | 705 | 704 | ||
292 | @@ -708,12 +707,14 @@ | |||
293 | 708 | logger.show(lec) # Won't "show" anything -- just gathers data. | 707 | logger.show(lec) # Won't "show" anything -- just gathers data. |
294 | 709 | 708 | ||
295 | 710 | page_contents = page_intro + lec.result() | 709 | page_contents = page_intro + lec.result() |
296 | 710 | |||
297 | 711 | def update_if_modified(moinfile): | 711 | def update_if_modified(moinfile): |
298 | 712 | if moinfile._unescape(moinfile.body) == page_contents: | 712 | if moinfile._unescape(moinfile.body) == page_contents: |
299 | 713 | return 0 # Nothing changed, so cancel the edit. | 713 | return 0 # Nothing changed, so cancel the edit. |
300 | 714 | else: | 714 | else: |
301 | 715 | moinfile.body = page_contents | 715 | moinfile.body = page_contents |
302 | 716 | return 1 | 716 | return 1 |
303 | 717 | |||
304 | 717 | if not dry_run: | 718 | if not dry_run: |
305 | 718 | if not quiet: | 719 | if not quiet: |
306 | 719 | print "Updating wiki..." | 720 | print "Updating wiki..." |