Merge lp://staging/~mbp/bzr/cleanup into lp://staging/bzr

Proposed by Martin Pool
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~mbp/bzr/cleanup
Merge into: lp://staging/bzr
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~mbp/bzr/cleanup
Reviewer Review Type Date Requested Status
Martin Pool Needs Fixing
Robert Collins (community) Approve
Review via email: mp+12020@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

This removes some softly-deprecated interfaces from bzrlib.trace, as a start towards larger cleanups.

Revision history for this message
Robert Collins (lifeless) wrote :

 review +1
with a small caveat: please grep for info in bzr-svn; gssapi using it
suggests to me that Jelmer will have used it in bzr-svn too.

-Rob

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

Good point - he does, I might do a deprecation warning on it instead.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-09-16 10:29:18 +0000
3+++ NEWS 2009-09-18 01:23:53 +0000
4@@ -100,6 +100,9 @@
5 * ``bzrlib.tests`` now uses ``stopTestRun`` for its ``TestResult``
6 subclasses - the same as python's unittest module. (Robert Collins)
7
8+* ``bzrlib.trace.log_error``, ``error`` and ``info`` have been removed.
9+ (Martin Pool)
10+
11 Internals
12 *********
13
14
15=== modified file 'bzrlib/check.py'
16--- bzrlib/check.py 2009-08-05 02:30:59 +0000
17+++ bzrlib/check.py 2009-09-18 01:06:10 +0000
18@@ -55,7 +55,7 @@
19 from bzrlib.repository import Repository
20 from bzrlib.revision import NULL_REVISION
21 from bzrlib.symbol_versioning import deprecated_function, deprecated_in
22-from bzrlib.trace import log_error, note
23+from bzrlib.trace import note
24 import bzrlib.ui
25 from bzrlib.workingtree import WorkingTree
26
27@@ -201,7 +201,7 @@
28 len(self.unreferenced_versions))
29 if verbose and len(self.unreferenced_versions):
30 for file_id, revision_id in self.unreferenced_versions:
31- log_error('unreferenced version: {%s} in %s', revision_id,
32+ note('unreferenced version: {%s} in %s', revision_id,
33 file_id)
34 if self.missing_inventory_sha_cnt:
35 note('%6d revisions are missing inventory_sha1',
36@@ -445,9 +445,9 @@
37 if do_branch:
38 scan_branch(branch, needed_refs, to_unlock)
39 if do_branch and not branches:
40- log_error("No branch found at specified location.")
41+ note("No branch found at specified location.")
42 if do_tree and base_tree is None and not saw_tree:
43- log_error("No working tree found at specified location.")
44+ note("No working tree found at specified location.")
45 if do_repo or do_branch or do_tree:
46 if do_repo:
47 note("Checking repository at '%s'."
48@@ -457,11 +457,11 @@
49 result.report_results(verbose)
50 else:
51 if do_tree:
52- log_error("No working tree found at specified location.")
53+ note("No working tree found at specified location.")
54 if do_branch:
55- log_error("No branch found at specified location.")
56+ note("No branch found at specified location.")
57 if do_repo:
58- log_error("No repository found at specified location.")
59+ note("No repository found at specified location.")
60 finally:
61 for thing in to_unlock:
62 thing.unlock()
63
64=== modified file 'bzrlib/commands.py'
65--- bzrlib/commands.py 2009-09-15 02:57:23 +0000
66+++ bzrlib/commands.py 2009-09-17 07:16:12 +0000
67@@ -101,11 +101,11 @@
68 registry.Registry.register(self, k_unsquished, cmd,
69 override_existing=decorate, info=info)
70 except KeyError:
71- trace.log_error('Two plugins defined the same command: %r' % k)
72- trace.log_error('Not loading the one in %r' %
73- sys.modules[cmd.__module__])
74- trace.log_error('Previously this command was registered from %r' %
75- sys.modules[previous.__module__])
76+ trace.warning('Two plugins defined the same command: %r' % k)
77+ trace.warning('Not loading the one in %r' %
78+ sys.modules[cmd.__module__])
79+ trace.warning('Previously this command was registered from %r' %
80+ sys.modules[previous.__module__])
81 return previous
82
83 def register_lazy(self, command_name, aliases, module_name):
84
85=== modified file 'bzrlib/foreign.py'
86--- bzrlib/foreign.py 2009-07-14 02:15:03 +0000
87+++ bzrlib/foreign.py 2009-09-18 01:25:08 +0000
88@@ -284,7 +284,6 @@
89 from bzrlib import urlutils
90 from bzrlib.bzrdir import BzrDir
91 from bzrlib.errors import BzrCommandError, NoWorkingTree
92- from bzrlib.trace import info
93 from bzrlib.workingtree import WorkingTree
94
95 if directory is None:
96
97=== modified file 'bzrlib/smart/server.py'
98--- bzrlib/smart/server.py 2009-07-20 11:27:05 +0000
99+++ bzrlib/smart/server.py 2009-09-18 01:08:24 +0000
100@@ -134,8 +134,7 @@
101 # dont log when CTRL-C'd.
102 raise
103 except Exception, e:
104- trace.error("Unhandled smart server error.")
105- trace.log_exception_quietly()
106+ trace.report_exception(sys.exc_info(), sys.stderr)
107 raise
108 finally:
109 self._stopped.set()
110
111=== modified file 'bzrlib/trace.py'
112--- bzrlib/trace.py 2009-09-03 02:59:56 +0000
113+++ bzrlib/trace.py 2009-09-18 01:24:30 +0000
114@@ -59,7 +59,6 @@
115 import logging
116 import os
117 import sys
118-import re
119 import time
120
121 from bzrlib.lazy_import import lazy_import
122@@ -123,14 +122,6 @@
123 _bzr_logger.warning(*args, **kwargs)
124
125
126-# configure convenient aliases for output routines
127-#
128-# TODO: deprecate them, have one name for each.
129-info = note
130-log_error = _bzr_logger.error
131-error = _bzr_logger.error
132-
133-
134 _last_mutter_flush_time = None
135
136 def mutter(fmt, *args):
137
138=== modified file 'bzrlib/transport/ftp/_gssapi.py'
139--- bzrlib/transport/ftp/_gssapi.py 2009-04-27 16:10:10 +0000
140+++ bzrlib/transport/ftp/_gssapi.py 2009-09-18 01:25:08 +0000
141@@ -25,7 +25,7 @@
142 config,
143 errors,
144 )
145-from bzrlib.trace import info, mutter
146+from bzrlib.trace import mutter
147 from bzrlib.transport.ftp import FtpTransport
148 from bzrlib.transport import register_transport_proto, register_transport
149
150@@ -81,7 +81,7 @@
151 if not ((resp.startswith('235 ') and rc == 1) or
152 (resp.startswith('335 ') and rc == 0)):
153 raise ftplib.error_reply, resp
154- info("Authenticated as %s" % kerberos.authGSSClientUserName(
155+ trace.note("Authenticated as %s" % kerberos.authGSSClientUserName(
156 self.vc))
157
158 # Monkey patch ftplib