Merge lp:~gagern/bzr/setlocale into lp:~bzr/bzr/trunk-old
- setlocale
- Merge into trunk-old
Proposed by
Martin von Gagern
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Robert Collins | ||||
Proposed branch: | lp:~gagern/bzr/setlocale | ||||
Merge into: | lp:~bzr/bzr/trunk-old | ||||
Diff against target: |
1220 lines (has conflicts)
Text conflict in NEWS Text conflict in bzrlib/log.py Text conflict in bzrlib/osutils.py Text conflict in bzrlib/tests/__init__.py Text conflict in bzrlib/tests/blackbox/test_info.py Text conflict in bzrlib/tests/test_log.py Text conflict in bzrlib/tests/test_selftest.py |
||||
To merge this branch: | bzr merge lp:~gagern/bzr/setlocale | ||||
Related bugs: |
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Martin von Gagern (gagern) wrote : | # |
Revision history for this message
Martin von Gagern (gagern) wrote : | # |
Sadly there is no "Abandoned" state, and I don't feel like deleting this request just after adding a useful comment to it. Maybe if I abandon the branch?
Revision history for this message
Vincent Ladeuil (vila) wrote : | # |
Rejected seems appropriate here.
And submit lp:~gagern/bzr/encodingSafeTests instead.
You can still reference this mp in your cover letter if you want to track it.
Revision history for this message
Robert Collins (lifeless) wrote : | # |
Marking rejected as per Vila's comment.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'NEWS' | |||
2 | --- NEWS 2009-08-30 23:51:10 +0000 | |||
3 | +++ NEWS 2009-08-31 04:38:49 +0000 | |||
4 | @@ -1,5 +1,6 @@ | |||
5 | 1 | #################### | 1 | #################### |
6 | 2 | Bazaar Release Notes | 2 | Bazaar Release Notes |
7 | 3 | <<<<<<< TREE | ||
8 | 3 | #################### | 4 | #################### |
9 | 4 | 5 | ||
10 | 5 | 6 | ||
11 | @@ -3869,6 +3870,108 @@ | |||
12 | 3869 | * ``RemoteToOtherFetcher`` and ``get_data_stream_for_search`` removed, | 3870 | * ``RemoteToOtherFetcher`` and ``get_data_stream_for_search`` removed, |
13 | 3870 | to support new ``VersionedFiles`` layering. | 3871 | to support new ``VersionedFiles`` layering. |
14 | 3871 | (Robert Collins) | 3872 | (Robert Collins) |
15 | 3873 | ======= | ||
16 | 3874 | -------------------- | ||
17 | 3875 | |||
18 | 3876 | .. contents:: | ||
19 | 3877 | |||
20 | 3878 | |||
21 | 3879 | IN DEVELOPMENT | ||
22 | 3880 | -------------- | ||
23 | 3881 | |||
24 | 3882 | IMPROVEMENTS: | ||
25 | 3883 | |||
26 | 3884 | * ``bzr export --format=tgz --root=NAME -`` to export a gzipped tarball | ||
27 | 3885 | to stdout; also ``tar`` and ``tbz2``. | ||
28 | 3886 | (Martin Pool) | ||
29 | 3887 | |||
30 | 3888 | * The smart protocol now has improved support for setting branches' | ||
31 | 3889 | revision info directly. This makes operations like push | ||
32 | 3890 | faster. The new request method name is | ||
33 | 3891 | ``Branch.set_last_revision_ex``. (Andrew Bennetts) | ||
34 | 3892 | |||
35 | 3893 | BUGFIXES: | ||
36 | 3894 | |||
37 | 3895 | * Clearer message about how to set the PYTHONPATH if bzrlib can't be | ||
38 | 3896 | loaded. | ||
39 | 3897 | (Martin Pool, #205230) | ||
40 | 3898 | |||
41 | 3899 | * Errors about missing libraries are now shown without a traceback, | ||
42 | 3900 | and with a suggestion to install the library. The full traceback is | ||
43 | 3901 | still in ``.bzr.log`` and can be shown with ``-Derror``. | ||
44 | 3902 | (Martin Pool, #240161) | ||
45 | 3903 | |||
46 | 3904 | * Handle urls such as ftp://user@host.com@www.host.com where the user | ||
47 | 3905 | name contains an @. | ||
48 | 3906 | (Neil Martinsen-Burrell, #228058) | ||
49 | 3907 | |||
50 | 3908 | * ``needs_read_lock`` and ``needs_write_lock`` now suppress an error during | ||
51 | 3909 | ``unlock`` if there was an error in the original function. This helps | ||
52 | 3910 | most when there is a failure with a smart server action, since often the | ||
53 | 3911 | connection closes and we cannot unlock. | ||
54 | 3912 | (Andrew Bennetts, John Arbash Meinel, #125784) | ||
55 | 3913 | |||
56 | 3914 | * Obsolete hidden command ``bzr fetch`` removed. | ||
57 | 3915 | (Martin Pool, #172870) | ||
58 | 3916 | |||
59 | 3917 | * Raise the correct exception when doing ``-rbefore:0`` or ``-c0``. | ||
60 | 3918 | (John Arbash Meinel, #239933) | ||
61 | 3919 | |||
62 | 3920 | * You can now compare file revisions in Windows diff programs from | ||
63 | 3921 | Cygwin Bazaar. | ||
64 | 3922 | (Matt McClure, #209281) | ||
65 | 3923 | |||
66 | 3924 | * revision_history now tolerates mainline ghosts for Branch format 6. | ||
67 | 3925 | (Aaron Bentley, #235055) | ||
68 | 3926 | |||
69 | 3927 | * Set locale from environment for third party libs and day of week. | ||
70 | 3928 | (Martin von Gagern, #128496) | ||
71 | 3929 | |||
72 | 3930 | DOCUMENTATION: | ||
73 | 3931 | |||
74 | 3932 | * Updated developer documentation. | ||
75 | 3933 | (Martin Pool) | ||
76 | 3934 | |||
77 | 3935 | TESTING: | ||
78 | 3936 | |||
79 | 3937 | * ``TestCaseWithTransport.make_branch_and_tree`` tries harder to return | ||
80 | 3938 | a tree with a ``branch`` attribute of the right format. This was | ||
81 | 3939 | preventing some ``RemoteBranch`` tests from actually running with | ||
82 | 3940 | ``RemoteBranch`` instances. (Andrew Bennetts) | ||
83 | 3941 | |||
84 | 3942 | API CHANGES: | ||
85 | 3943 | |||
86 | 3944 | * Removed ``Repository.text_store``, ``control_store``, etc. Instead, | ||
87 | 3945 | there are new attributes ``texts, inventories, revisions, | ||
88 | 3946 | signatures``, each of which is a ``VersionedFiles``. See the | ||
89 | 3947 | Repository docstring for more details. | ||
90 | 3948 | (Robert Collins) | ||
91 | 3949 | |||
92 | 3950 | * ``Branch.pull`` now accepts an ``_override_hook_target`` optional | ||
93 | 3951 | parameter. If you have a subclass of ``Branch`` that overrides | ||
94 | 3952 | ``pull`` then you should add this parameter. (Andrew Bennetts) | ||
95 | 3953 | |||
96 | 3954 | * ``Tree.print_file`` and ``Repository.print_file`` are deprecated. | ||
97 | 3955 | These methods are bad APIs because they write directly to sys.stdout. | ||
98 | 3956 | bzrlib does not use them internally, and there are no direct tests | ||
99 | 3957 | for them. (Alexander Belchenko) | ||
100 | 3958 | |||
101 | 3959 | INTERNALS: | ||
102 | 3960 | |||
103 | 3961 | * ``cat`` command no longer uses ``Tree.print_file()`` internally. | ||
104 | 3962 | (Alexander Belchenko) | ||
105 | 3963 | |||
106 | 3964 | * New ``versionedfile.KeyMapper`` interface to abstract out the access to | ||
107 | 3965 | underlying .knit/.kndx etc files in repositories with partitioned | ||
108 | 3966 | storage. (Robert Collins) | ||
109 | 3967 | |||
110 | 3968 | * Obsolete developer-use command ``weave-join`` has been removed. | ||
111 | 3969 | (Robert Collins) | ||
112 | 3970 | |||
113 | 3971 | * ``RemoteToOtherFetcher`` and ``get_data_stream_for_search`` removed, | ||
114 | 3972 | to support new ``VersionedFiles`` layering. | ||
115 | 3973 | (Robert Collins) | ||
116 | 3974 | >>>>>>> MERGE-SOURCE | ||
117 | 3872 | 3975 | ||
118 | 3873 | 3976 | ||
119 | 3874 | bzr 1.6beta2 2008-06-10 | 3977 | bzr 1.6beta2 2008-06-10 |
120 | 3875 | 3978 | ||
121 | === modified file 'bzrlib/info.py' | |||
122 | --- bzrlib/info.py 2009-05-01 14:29:06 +0000 | |||
123 | +++ bzrlib/info.py 2009-08-31 04:38:49 +0000 | |||
124 | @@ -286,10 +286,10 @@ | |||
125 | 286 | age = int((time.time() - timestamp) / 3600 / 24) | 286 | age = int((time.time() - timestamp) / 3600 / 24) |
126 | 287 | outfile.write(' %8d day%s old\n' % (age, plural(age))) | 287 | outfile.write(' %8d day%s old\n' % (age, plural(age))) |
127 | 288 | outfile.write(' first revision: %s\n' % | 288 | outfile.write(' first revision: %s\n' % |
129 | 289 | osutils.format_date(timestamp, timezone)) | 289 | osutils.format_date(timestamp, timezone, local_weekday=True)) |
130 | 290 | timestamp, timezone = stats['latestrev'] | 290 | timestamp, timezone = stats['latestrev'] |
131 | 291 | outfile.write(' latest revision: %s\n' % | 291 | outfile.write(' latest revision: %s\n' % |
133 | 292 | osutils.format_date(timestamp, timezone)) | 292 | osutils.format_date(timestamp, timezone, local_weekday=True)) |
134 | 293 | return stats | 293 | return stats |
135 | 294 | 294 | ||
136 | 295 | 295 | ||
137 | 296 | 296 | ||
138 | === modified file 'bzrlib/log.py' | |||
139 | --- bzrlib/log.py 2009-06-10 03:56:49 +0000 | |||
140 | +++ bzrlib/log.py 2009-08-31 04:38:49 +0000 | |||
141 | @@ -1447,7 +1447,7 @@ | |||
142 | 1447 | 1447 | ||
143 | 1448 | date_str = format_date(revision.rev.timestamp, | 1448 | date_str = format_date(revision.rev.timestamp, |
144 | 1449 | revision.rev.timezone or 0, | 1449 | revision.rev.timezone or 0, |
146 | 1450 | self.show_timezone) | 1450 | self.show_timezone, local_weekday=True) |
147 | 1451 | to_file.write(indent + 'timestamp: %s\n' % (date_str,)) | 1451 | to_file.write(indent + 'timestamp: %s\n' % (date_str,)) |
148 | 1452 | 1452 | ||
149 | 1453 | to_file.write(indent + 'message:\n') | 1453 | to_file.write(indent + 'message:\n') |
150 | @@ -1505,11 +1505,19 @@ | |||
151 | 1505 | offset = ' ' * (revno_width + 1) | 1505 | offset = ' ' * (revno_width + 1) |
152 | 1506 | 1506 | ||
153 | 1507 | to_file = self.to_file | 1507 | to_file = self.to_file |
154 | 1508 | <<<<<<< TREE | ||
155 | 1508 | tags = '' | 1509 | tags = '' |
156 | 1509 | if revision.tags: | 1510 | if revision.tags: |
157 | 1510 | tags = ' {%s}' % (', '.join(revision.tags)) | 1511 | tags = ' {%s}' % (', '.join(revision.tags)) |
158 | 1511 | to_file.write(indent + "%*s %s\t%s%s%s\n" % (revno_width, | 1512 | to_file.write(indent + "%*s %s\t%s%s%s\n" % (revno_width, |
159 | 1512 | revision.revno, self.short_author(revision.rev), | 1513 | revision.revno, self.short_author(revision.rev), |
160 | 1514 | ======= | ||
161 | 1515 | is_merge = '' | ||
162 | 1516 | if len(revision.rev.parent_ids) > 1: | ||
163 | 1517 | is_merge = ' [merge]' | ||
164 | 1518 | to_file.write("%5s %s\t%s%s\n" % (revision.revno, | ||
165 | 1519 | self.short_author(revision.rev), | ||
166 | 1520 | >>>>>>> MERGE-SOURCE | ||
167 | 1513 | format_date(revision.rev.timestamp, | 1521 | format_date(revision.rev.timestamp, |
168 | 1514 | revision.rev.timezone or 0, | 1522 | revision.rev.timezone or 0, |
169 | 1515 | self.show_timezone, date_fmt="%Y-%m-%d", | 1523 | self.show_timezone, date_fmt="%Y-%m-%d", |
170 | 1516 | 1524 | ||
171 | === modified file 'bzrlib/osutils.py' | |||
172 | --- bzrlib/osutils.py 2009-07-23 16:01:17 +0000 | |||
173 | +++ bzrlib/osutils.py 2009-08-31 04:38:49 +0000 | |||
174 | @@ -689,7 +689,7 @@ | |||
175 | 689 | weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] | 689 | weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] |
176 | 690 | 690 | ||
177 | 691 | def format_date(t, offset=0, timezone='original', date_fmt=None, | 691 | def format_date(t, offset=0, timezone='original', date_fmt=None, |
179 | 692 | show_offset=True): | 692 | show_offset=True, local_weekday=False): |
180 | 693 | """Return a formatted date string. | 693 | """Return a formatted date string. |
181 | 694 | 694 | ||
182 | 695 | :param t: Seconds since the epoch. | 695 | :param t: Seconds since the epoch. |
183 | @@ -744,7 +744,16 @@ | |||
184 | 744 | offset_str = ' %+03d%02d' % (offset / 3600, (offset / 60) % 60) | 744 | offset_str = ' %+03d%02d' % (offset / 3600, (offset / 60) % 60) |
185 | 745 | else: | 745 | else: |
186 | 746 | offset_str = '' | 746 | offset_str = '' |
187 | 747 | <<<<<<< TREE | ||
188 | 747 | return (date_fmt, tt, offset_str) | 748 | return (date_fmt, tt, offset_str) |
189 | 749 | ======= | ||
190 | 750 | if not local_weekday: | ||
191 | 751 | date_fmt = date_fmt.replace('%a', weekdays[tt[6]]) | ||
192 | 752 | date_str = time.strftime(date_fmt, tt) | ||
193 | 753 | if not isinstance(date_str, unicode): | ||
194 | 754 | date_str = date_str.decode(bzrlib.user_encoding, 'replace') | ||
195 | 755 | return date_str + offset_str | ||
196 | 756 | >>>>>>> MERGE-SOURCE | ||
197 | 748 | 757 | ||
198 | 749 | 758 | ||
199 | 750 | def compact_date(when): | 759 | def compact_date(when): |
200 | 751 | 760 | ||
201 | === modified file 'bzrlib/tests/__init__.py' | |||
202 | --- bzrlib/tests/__init__.py 2009-08-28 21:05:31 +0000 | |||
203 | +++ bzrlib/tests/__init__.py 2009-08-31 04:38:49 +0000 | |||
204 | @@ -115,10 +115,22 @@ | |||
205 | 115 | 115 | ||
206 | 116 | default_transport = LocalURLServer | 116 | default_transport = LocalURLServer |
207 | 117 | 117 | ||
208 | 118 | <<<<<<< TREE | ||
209 | 118 | # Subunit result codes, defined here to prevent a hard dependency on subunit. | 119 | # Subunit result codes, defined here to prevent a hard dependency on subunit. |
210 | 119 | SUBUNIT_SEEK_SET = 0 | 120 | SUBUNIT_SEEK_SET = 0 |
211 | 120 | SUBUNIT_SEEK_CUR = 1 | 121 | SUBUNIT_SEEK_CUR = 1 |
212 | 121 | 122 | ||
213 | 123 | ======= | ||
214 | 124 | def _safe_string(string_or_unicode): | ||
215 | 125 | if isinstance(string_or_unicode, str): | ||
216 | 126 | return string_or_unicode.encode('string_escape').replace(r'\n', '\n') | ||
217 | 127 | if isinstance(string_or_unicode, unicode): | ||
218 | 128 | return string_or_unicode.encode('unicode_escape').replace(r'\n', '\n') | ||
219 | 129 | if string_or_unicode is None: | ||
220 | 130 | return '<None>' | ||
221 | 131 | return str(string_or_unicode).encode('string_escape') | ||
222 | 132 | |||
223 | 133 | >>>>>>> MERGE-SOURCE | ||
224 | 122 | 134 | ||
225 | 123 | class ExtendedTestResult(unittest._TextTestResult): | 135 | class ExtendedTestResult(unittest._TextTestResult): |
226 | 124 | """Accepts, reports and accumulates the results of running tests. | 136 | """Accepts, reports and accumulates the results of running tests. |
227 | @@ -503,21 +515,37 @@ | |||
228 | 503 | def _test_description(self, test): | 515 | def _test_description(self, test): |
229 | 504 | return self._shortened_test_description(test) | 516 | return self._shortened_test_description(test) |
230 | 505 | 517 | ||
231 | 518 | def _report(self, kind, test, err): | ||
232 | 519 | descr = self._test_description(test) | ||
233 | 520 | msg = err[1] | ||
234 | 521 | try: | ||
235 | 522 | self.pb.note('%s: %s\n %s\n', kind, descr, msg) | ||
236 | 523 | except UnicodeError: | ||
237 | 524 | self.pb.note('%s: %s\n %s\n', kind, | ||
238 | 525 | _safe_string(descr), _safe_string(msg)) | ||
239 | 526 | |||
240 | 506 | def report_error(self, test, err): | 527 | def report_error(self, test, err): |
241 | 528 | <<<<<<< TREE | ||
242 | 507 | self.pb.note('ERROR: %s\n %s\n', | 529 | self.pb.note('ERROR: %s\n %s\n', |
243 | 508 | self._test_description(test), | 530 | self._test_description(test), |
244 | 509 | err[1], | 531 | err[1], |
245 | 510 | ) | 532 | ) |
246 | 533 | ======= | ||
247 | 534 | self._report('ERROR', test, err); | ||
248 | 535 | >>>>>>> MERGE-SOURCE | ||
249 | 511 | 536 | ||
250 | 512 | def report_failure(self, test, err): | 537 | def report_failure(self, test, err): |
251 | 538 | <<<<<<< TREE | ||
252 | 513 | self.pb.note('FAIL: %s\n %s\n', | 539 | self.pb.note('FAIL: %s\n %s\n', |
253 | 514 | self._test_description(test), | 540 | self._test_description(test), |
254 | 515 | err[1], | 541 | err[1], |
255 | 516 | ) | 542 | ) |
256 | 543 | ======= | ||
257 | 544 | self._report('FAIL', test, err); | ||
258 | 545 | >>>>>>> MERGE-SOURCE | ||
259 | 517 | 546 | ||
260 | 518 | def report_known_failure(self, test, err): | 547 | def report_known_failure(self, test, err): |
263 | 519 | self.pb.note('XFAIL: %s\n%s\n', | 548 | self._report('XFAIL', test, err); |
262 | 520 | self._test_description(test), err[1]) | ||
264 | 521 | 549 | ||
265 | 522 | def report_skip(self, test, reason): | 550 | def report_skip(self, test, reason): |
266 | 523 | pass | 551 | pass |
267 | @@ -986,9 +1014,18 @@ | |||
268 | 986 | message = 'first string is missing a final newline.\n' | 1014 | message = 'first string is missing a final newline.\n' |
269 | 987 | if a + '\n' == b: | 1015 | if a + '\n' == b: |
270 | 988 | message = 'second string is missing a final newline.\n' | 1016 | message = 'second string is missing a final newline.\n' |
271 | 1017 | <<<<<<< TREE | ||
272 | 989 | raise AssertionError(message + | 1018 | raise AssertionError(message + |
273 | 990 | self._ndiff_strings(a, b)) | 1019 | self._ndiff_strings(a, b)) |
274 | 991 | 1020 | ||
275 | 1021 | ======= | ||
276 | 1022 | try: | ||
277 | 1023 | diff = self._ndiff_strings(a, b) | ||
278 | 1024 | except UnicodeError: | ||
279 | 1025 | diff = self._ndiff_strings(_safe_string(a), _safe_string(b)) | ||
280 | 1026 | raise AssertionError(message + diff) | ||
281 | 1027 | |||
282 | 1028 | >>>>>>> MERGE-SOURCE | ||
283 | 992 | def assertEqualMode(self, mode, mode_test): | 1029 | def assertEqualMode(self, mode, mode_test): |
284 | 993 | self.assertEqual(mode, mode_test, | 1030 | self.assertEqual(mode, mode_test, |
285 | 994 | 'mode mismatch %o != %o' % (mode, mode_test)) | 1031 | 'mode mismatch %o != %o' % (mode, mode_test)) |
286 | @@ -3973,11 +4010,15 @@ | |||
287 | 3973 | 4010 | ||
288 | 3974 | def _probe(self): | 4011 | def _probe(self): |
289 | 3975 | try: | 4012 | try: |
290 | 4013 | <<<<<<< TREE | ||
291 | 3976 | # Check for character combinations unlikely to be covered by any | 4014 | # Check for character combinations unlikely to be covered by any |
292 | 3977 | # single non-unicode encoding. We use the characters | 4015 | # single non-unicode encoding. We use the characters |
293 | 3978 | # - greek small letter alpha (U+03B1) and | 4016 | # - greek small letter alpha (U+03B1) and |
294 | 3979 | # - braille pattern dots-123456 (U+283F). | 4017 | # - braille pattern dots-123456 (U+283F). |
295 | 3980 | os.stat(u'\u03b1\u283f') | 4018 | os.stat(u'\u03b1\u283f') |
296 | 4019 | ======= | ||
297 | 4020 | os.stat(u'\u03b1\u283f') | ||
298 | 4021 | >>>>>>> MERGE-SOURCE | ||
299 | 3981 | except UnicodeEncodeError: | 4022 | except UnicodeEncodeError: |
300 | 3982 | return False | 4023 | return False |
301 | 3983 | except (IOError, OSError): | 4024 | except (IOError, OSError): |
302 | 3984 | 4025 | ||
303 | === modified file 'bzrlib/tests/blackbox/test_info.py' | |||
304 | --- bzrlib/tests/blackbox/test_info.py 2009-08-25 23:38:10 +0000 | |||
305 | +++ bzrlib/tests/blackbox/test_info.py 2009-08-31 04:38:49 +0000 | |||
306 | @@ -129,7 +129,7 @@ | |||
307 | 129 | self.assertEqual('', err) | 129 | self.assertEqual('', err) |
308 | 130 | tree1.commit('commit one') | 130 | tree1.commit('commit one') |
309 | 131 | rev = branch1.repository.get_revision(branch1.revision_history()[0]) | 131 | rev = branch1.repository.get_revision(branch1.revision_history()[0]) |
311 | 132 | datestring_first = format_date(rev.timestamp, rev.timezone) | 132 | datestring_first = format_date(rev.timestamp, rev.timezone, local_weekday=True) |
312 | 133 | 133 | ||
313 | 134 | # Branch standalone with push location | 134 | # Branch standalone with push location |
314 | 135 | branch2 = branch1.bzrdir.sprout('branch').open_branch() | 135 | branch2 = branch1.bzrdir.sprout('branch').open_branch() |
315 | @@ -148,7 +148,7 @@ | |||
316 | 148 | self.assertEqual('', err) | 148 | self.assertEqual('', err) |
317 | 149 | 149 | ||
318 | 150 | out, err = self.run_bzr('info branch --verbose') | 150 | out, err = self.run_bzr('info branch --verbose') |
320 | 151 | self.assertEqualDiff( | 151 | self.assertEqualDiff(( |
321 | 152 | """Standalone tree (format: weave) | 152 | """Standalone tree (format: weave) |
322 | 153 | Location: | 153 | Location: |
323 | 154 | branch root: branch | 154 | branch root: branch |
324 | @@ -182,7 +182,7 @@ | |||
325 | 182 | Repository: | 182 | Repository: |
326 | 183 | 1 revision | 183 | 1 revision |
327 | 184 | """ % (datestring_first, datestring_first, | 184 | """ % (datestring_first, datestring_first, |
329 | 185 | ), out) | 185 | )).encode(bzrlib.user_encoding), out) |
330 | 186 | self.assertEqual('', err) | 186 | self.assertEqual('', err) |
331 | 187 | 187 | ||
332 | 188 | # Branch and bind to standalone, needs upgrade to metadir | 188 | # Branch and bind to standalone, needs upgrade to metadir |
333 | @@ -194,7 +194,7 @@ | |||
334 | 194 | branch3.bind(branch1) | 194 | branch3.bind(branch1) |
335 | 195 | bound_tree = branch3.bzrdir.open_workingtree() | 195 | bound_tree = branch3.bzrdir.open_workingtree() |
336 | 196 | out, err = self.run_bzr('info -v bound') | 196 | out, err = self.run_bzr('info -v bound') |
338 | 197 | self.assertEqualDiff( | 197 | self.assertEqualDiff(( |
339 | 198 | """Checkout (format: knit) | 198 | """Checkout (format: knit) |
340 | 199 | Location: | 199 | Location: |
341 | 200 | checkout root: bound | 200 | checkout root: bound |
342 | @@ -231,7 +231,7 @@ | |||
343 | 231 | branch3._format.get_format_description(), | 231 | branch3._format.get_format_description(), |
344 | 232 | branch3.repository._format.get_format_description(), | 232 | branch3.repository._format.get_format_description(), |
345 | 233 | datestring_first, datestring_first, | 233 | datestring_first, datestring_first, |
347 | 234 | ), out) | 234 | )).encode(bzrlib.user_encoding), out) |
348 | 235 | self.assertEqual('', err) | 235 | self.assertEqual('', err) |
349 | 236 | 236 | ||
350 | 237 | # Checkout standalone (same as above, but does not have parent set) | 237 | # Checkout standalone (same as above, but does not have parent set) |
351 | @@ -240,7 +240,7 @@ | |||
352 | 240 | branch4.bind(branch1) | 240 | branch4.bind(branch1) |
353 | 241 | branch4.bzrdir.open_workingtree().update() | 241 | branch4.bzrdir.open_workingtree().update() |
354 | 242 | out, err = self.run_bzr('info checkout --verbose') | 242 | out, err = self.run_bzr('info checkout --verbose') |
356 | 243 | self.assertEqualDiff( | 243 | self.assertEqualDiff(( |
357 | 244 | """Checkout (format: knit) | 244 | """Checkout (format: knit) |
358 | 245 | Location: | 245 | Location: |
359 | 246 | checkout root: checkout | 246 | checkout root: checkout |
360 | @@ -272,15 +272,21 @@ | |||
361 | 272 | 1 revision | 272 | 1 revision |
362 | 273 | """ % (branch4.repository._format.get_format_description(), | 273 | """ % (branch4.repository._format.get_format_description(), |
363 | 274 | datestring_first, datestring_first, | 274 | datestring_first, datestring_first, |
365 | 275 | ), out) | 275 | )).encode(bzrlib.user_encoding), out) |
366 | 276 | self.assertEqual('', err) | 276 | self.assertEqual('', err) |
367 | 277 | 277 | ||
368 | 278 | # Lightweight checkout (same as above, different branch and repository) | 278 | # Lightweight checkout (same as above, different branch and repository) |
369 | 279 | tree5 = branch1.create_checkout('lightcheckout', lightweight=True) | 279 | tree5 = branch1.create_checkout('lightcheckout', lightweight=True) |
370 | 280 | branch5 = tree5.branch | 280 | branch5 = tree5.branch |
371 | 281 | out, err = self.run_bzr('info -v lightcheckout') | 281 | out, err = self.run_bzr('info -v lightcheckout') |
372 | 282 | <<<<<<< TREE | ||
373 | 282 | self.assertEqualDiff( | 283 | self.assertEqualDiff( |
374 | 283 | """Lightweight checkout (format: %s) | 284 | """Lightweight checkout (format: %s) |
375 | 285 | ======= | ||
376 | 286 | self.assertEqualDiff(( | ||
377 | 287 | """Lightweight checkout (format: dirstate or dirstate-tags or \ | ||
378 | 288 | pack-0.92 or rich-root or rich-root-pack) | ||
379 | 289 | >>>>>>> MERGE-SOURCE | ||
380 | 284 | Location: | 290 | Location: |
381 | 285 | light checkout root: lightcheckout | 291 | light checkout root: lightcheckout |
382 | 286 | checkout of branch: standalone | 292 | checkout of branch: standalone |
383 | @@ -309,7 +315,11 @@ | |||
384 | 309 | 315 | ||
385 | 310 | Repository: | 316 | Repository: |
386 | 311 | 1 revision | 317 | 1 revision |
387 | 318 | <<<<<<< TREE | ||
388 | 312 | """ % (self._repo_strings, datestring_first, datestring_first,), out) | 319 | """ % (self._repo_strings, datestring_first, datestring_first,), out) |
389 | 320 | ======= | ||
390 | 321 | """ % (datestring_first, datestring_first,)).encode(bzrlib.user_encoding), out) | ||
391 | 322 | >>>>>>> MERGE-SOURCE | ||
392 | 313 | self.assertEqual('', err) | 323 | self.assertEqual('', err) |
393 | 314 | 324 | ||
394 | 315 | # Update initial standalone branch | 325 | # Update initial standalone branch |
395 | @@ -317,11 +327,11 @@ | |||
396 | 317 | tree1.add('b') | 327 | tree1.add('b') |
397 | 318 | tree1.commit('commit two') | 328 | tree1.commit('commit two') |
398 | 319 | rev = branch1.repository.get_revision(branch1.revision_history()[-1]) | 329 | rev = branch1.repository.get_revision(branch1.revision_history()[-1]) |
400 | 320 | datestring_last = format_date(rev.timestamp, rev.timezone) | 330 | datestring_last = format_date(rev.timestamp, rev.timezone, local_weekday=True) |
401 | 321 | 331 | ||
402 | 322 | # Out of date branched standalone branch will not be detected | 332 | # Out of date branched standalone branch will not be detected |
403 | 323 | out, err = self.run_bzr('info -v branch') | 333 | out, err = self.run_bzr('info -v branch') |
405 | 324 | self.assertEqualDiff( | 334 | self.assertEqualDiff(( |
406 | 325 | """Standalone tree (format: weave) | 335 | """Standalone tree (format: weave) |
407 | 326 | Location: | 336 | Location: |
408 | 327 | branch root: branch | 337 | branch root: branch |
409 | @@ -355,12 +365,12 @@ | |||
410 | 355 | Repository: | 365 | Repository: |
411 | 356 | 1 revision | 366 | 1 revision |
412 | 357 | """ % (datestring_first, datestring_first, | 367 | """ % (datestring_first, datestring_first, |
414 | 358 | ), out) | 368 | )).encode(bzrlib.user_encoding), out) |
415 | 359 | self.assertEqual('', err) | 369 | self.assertEqual('', err) |
416 | 360 | 370 | ||
417 | 361 | # Out of date bound branch | 371 | # Out of date bound branch |
418 | 362 | out, err = self.run_bzr('info -v bound') | 372 | out, err = self.run_bzr('info -v bound') |
420 | 363 | self.assertEqualDiff( | 373 | self.assertEqualDiff(( |
421 | 364 | """Checkout (format: knit) | 374 | """Checkout (format: knit) |
422 | 365 | Location: | 375 | Location: |
423 | 366 | checkout root: bound | 376 | checkout root: bound |
424 | @@ -397,12 +407,12 @@ | |||
425 | 397 | 1 revision | 407 | 1 revision |
426 | 398 | """ % (branch3.repository._format.get_format_description(), | 408 | """ % (branch3.repository._format.get_format_description(), |
427 | 399 | datestring_first, datestring_first, | 409 | datestring_first, datestring_first, |
429 | 400 | ), out) | 410 | )).encode(bzrlib.user_encoding), out) |
430 | 401 | self.assertEqual('', err) | 411 | self.assertEqual('', err) |
431 | 402 | 412 | ||
432 | 403 | # Out of date checkout | 413 | # Out of date checkout |
433 | 404 | out, err = self.run_bzr('info -v checkout') | 414 | out, err = self.run_bzr('info -v checkout') |
435 | 405 | self.assertEqualDiff( | 415 | self.assertEqualDiff(( |
436 | 406 | """Checkout (format: knit) | 416 | """Checkout (format: knit) |
437 | 407 | Location: | 417 | Location: |
438 | 408 | checkout root: checkout | 418 | checkout root: checkout |
439 | @@ -436,13 +446,19 @@ | |||
440 | 436 | 1 revision | 446 | 1 revision |
441 | 437 | """ % (branch4.repository._format.get_format_description(), | 447 | """ % (branch4.repository._format.get_format_description(), |
442 | 438 | datestring_first, datestring_first, | 448 | datestring_first, datestring_first, |
444 | 439 | ), out) | 449 | )).encode(bzrlib.user_encoding), out) |
445 | 440 | self.assertEqual('', err) | 450 | self.assertEqual('', err) |
446 | 441 | 451 | ||
447 | 442 | # Out of date lightweight checkout | 452 | # Out of date lightweight checkout |
448 | 443 | out, err = self.run_bzr('info lightcheckout --verbose') | 453 | out, err = self.run_bzr('info lightcheckout --verbose') |
449 | 454 | <<<<<<< TREE | ||
450 | 444 | self.assertEqualDiff( | 455 | self.assertEqualDiff( |
451 | 445 | """Lightweight checkout (format: %s) | 456 | """Lightweight checkout (format: %s) |
452 | 457 | ======= | ||
453 | 458 | self.assertEqualDiff(( | ||
454 | 459 | """Lightweight checkout (format: dirstate or dirstate-tags or \ | ||
455 | 460 | pack-0.92 or rich-root or rich-root-pack) | ||
456 | 461 | >>>>>>> MERGE-SOURCE | ||
457 | 446 | Location: | 462 | Location: |
458 | 447 | light checkout root: lightcheckout | 463 | light checkout root: lightcheckout |
459 | 448 | checkout of branch: standalone | 464 | checkout of branch: standalone |
460 | @@ -473,7 +489,11 @@ | |||
461 | 473 | 489 | ||
462 | 474 | Repository: | 490 | Repository: |
463 | 475 | 2 revisions | 491 | 2 revisions |
464 | 492 | <<<<<<< TREE | ||
465 | 476 | """ % (self._repo_strings, datestring_first, datestring_last,), out) | 493 | """ % (self._repo_strings, datestring_first, datestring_last,), out) |
466 | 494 | ======= | ||
467 | 495 | """ % (datestring_first, datestring_last,)).encode(bzrlib.user_encoding), out) | ||
468 | 496 | >>>>>>> MERGE-SOURCE | ||
469 | 477 | self.assertEqual('', err) | 497 | self.assertEqual('', err) |
470 | 478 | 498 | ||
471 | 479 | def test_info_standalone_no_tree(self): | 499 | def test_info_standalone_no_tree(self): |
472 | @@ -482,7 +502,7 @@ | |||
473 | 482 | branch = self.make_branch('branch') | 502 | branch = self.make_branch('branch') |
474 | 483 | repo = branch.repository | 503 | repo = branch.repository |
475 | 484 | out, err = self.run_bzr('info branch -v') | 504 | out, err = self.run_bzr('info branch -v') |
477 | 485 | self.assertEqualDiff( | 505 | self.assertEqualDiff(( |
478 | 486 | """Standalone branch (format: %s) | 506 | """Standalone branch (format: %s) |
479 | 487 | Location: | 507 | Location: |
480 | 488 | branch root: branch | 508 | branch root: branch |
481 | @@ -500,7 +520,7 @@ | |||
482 | 500 | """ % (info.describe_format(repo.bzrdir, repo, branch, None), | 520 | """ % (info.describe_format(repo.bzrdir, repo, branch, None), |
483 | 501 | format.get_branch_format().get_format_description(), | 521 | format.get_branch_format().get_format_description(), |
484 | 502 | format.repository_format.get_format_description(), | 522 | format.repository_format.get_format_description(), |
486 | 503 | ), out) | 523 | )).encode(bzrlib.user_encoding), out) |
487 | 504 | self.assertEqual('', err) | 524 | self.assertEqual('', err) |
488 | 505 | 525 | ||
489 | 506 | def test_info_shared_repository(self): | 526 | def test_info_shared_repository(self): |
490 | @@ -511,7 +531,7 @@ | |||
491 | 511 | repo = self.make_repository('repo', shared=True, format=format) | 531 | repo = self.make_repository('repo', shared=True, format=format) |
492 | 512 | repo.set_make_working_trees(False) | 532 | repo.set_make_working_trees(False) |
493 | 513 | out, err = self.run_bzr('info -v repo') | 533 | out, err = self.run_bzr('info -v repo') |
495 | 514 | self.assertEqualDiff( | 534 | self.assertEqualDiff(( |
496 | 515 | """Shared repository (format: dirstate or dirstate-tags or knit) | 535 | """Shared repository (format: dirstate or dirstate-tags or knit) |
497 | 516 | Location: | 536 | Location: |
498 | 517 | shared repository: %s | 537 | shared repository: %s |
499 | @@ -523,7 +543,7 @@ | |||
500 | 523 | Repository: | 543 | Repository: |
501 | 524 | 0 revisions | 544 | 0 revisions |
502 | 525 | """ % ('repo', format.repository_format.get_format_description(), | 545 | """ % ('repo', format.repository_format.get_format_description(), |
504 | 526 | ), out) | 546 | )).encode(bzrlib.user_encoding), out) |
505 | 527 | self.assertEqual('', err) | 547 | self.assertEqual('', err) |
506 | 528 | 548 | ||
507 | 529 | # Create branch inside shared repository | 549 | # Create branch inside shared repository |
508 | @@ -531,7 +551,7 @@ | |||
509 | 531 | branch1 = repo.bzrdir.create_branch_convenience('repo/branch', | 551 | branch1 = repo.bzrdir.create_branch_convenience('repo/branch', |
510 | 532 | format=format) | 552 | format=format) |
511 | 533 | out, err = self.run_bzr('info -v repo/branch') | 553 | out, err = self.run_bzr('info -v repo/branch') |
513 | 534 | self.assertEqualDiff( | 554 | self.assertEqualDiff(( |
514 | 535 | """Repository branch (format: dirstate or knit) | 555 | """Repository branch (format: dirstate or knit) |
515 | 536 | Location: | 556 | Location: |
516 | 537 | shared repository: repo | 557 | shared repository: repo |
517 | @@ -549,7 +569,7 @@ | |||
518 | 549 | 0 revisions | 569 | 0 revisions |
519 | 550 | """ % (format.get_branch_format().get_format_description(), | 570 | """ % (format.get_branch_format().get_format_description(), |
520 | 551 | format.repository_format.get_format_description(), | 571 | format.repository_format.get_format_description(), |
522 | 552 | ), out) | 572 | )).encode(bzrlib.user_encoding), out) |
523 | 553 | self.assertEqual('', err) | 573 | self.assertEqual('', err) |
524 | 554 | 574 | ||
525 | 555 | # Create lightweight checkout | 575 | # Create lightweight checkout |
526 | @@ -571,10 +591,16 @@ | |||
527 | 571 | tree2.add('a') | 591 | tree2.add('a') |
528 | 572 | tree2.commit('commit one') | 592 | tree2.commit('commit one') |
529 | 573 | rev = repo.get_revision(branch2.revision_history()[0]) | 593 | rev = repo.get_revision(branch2.revision_history()[0]) |
531 | 574 | datestring_first = format_date(rev.timestamp, rev.timezone) | 594 | datestring_first = format_date(rev.timestamp, rev.timezone, local_weekday=True) |
532 | 575 | out, err = self.run_bzr('info tree/lightcheckout --verbose') | 595 | out, err = self.run_bzr('info tree/lightcheckout --verbose') |
533 | 596 | <<<<<<< TREE | ||
534 | 576 | self.assertEqualDiff( | 597 | self.assertEqualDiff( |
535 | 577 | """Lightweight checkout (format: %s) | 598 | """Lightweight checkout (format: %s) |
536 | 599 | ======= | ||
537 | 600 | self.assertEqualDiff(( | ||
538 | 601 | """Lightweight checkout (format: dirstate or dirstate-tags or \ | ||
539 | 602 | pack-0.92 or rich-root or rich-root-pack) | ||
540 | 603 | >>>>>>> MERGE-SOURCE | ||
541 | 578 | Location: | 604 | Location: |
542 | 579 | light checkout root: tree/lightcheckout | 605 | light checkout root: tree/lightcheckout |
543 | 580 | checkout of branch: repo/branch | 606 | checkout of branch: repo/branch |
544 | @@ -607,13 +633,18 @@ | |||
545 | 607 | """ % (self._repo_strings, format.get_branch_format().get_format_description(), | 633 | """ % (self._repo_strings, format.get_branch_format().get_format_description(), |
546 | 608 | format.repository_format.get_format_description(), | 634 | format.repository_format.get_format_description(), |
547 | 609 | datestring_first, datestring_first, | 635 | datestring_first, datestring_first, |
549 | 610 | ), out) | 636 | )).encode(bzrlib.user_encoding), out) |
550 | 611 | self.assertEqual('', err) | 637 | self.assertEqual('', err) |
551 | 612 | 638 | ||
552 | 613 | # Out of date checkout | 639 | # Out of date checkout |
553 | 614 | out, err = self.run_bzr('info -v tree/checkout') | 640 | out, err = self.run_bzr('info -v tree/checkout') |
554 | 641 | <<<<<<< TREE | ||
555 | 615 | self.assertEqualDiff( | 642 | self.assertEqualDiff( |
556 | 616 | """Checkout (format: unnamed) | 643 | """Checkout (format: unnamed) |
557 | 644 | ======= | ||
558 | 645 | self.assertEqualDiff(( | ||
559 | 646 | """Checkout (format: dirstate) | ||
560 | 647 | >>>>>>> MERGE-SOURCE | ||
561 | 617 | Location: | 648 | Location: |
562 | 618 | checkout root: tree/checkout | 649 | checkout root: tree/checkout |
563 | 619 | checkout of branch: repo/branch | 650 | checkout of branch: repo/branch |
564 | @@ -643,7 +674,7 @@ | |||
565 | 643 | 0 revisions | 674 | 0 revisions |
566 | 644 | """ % (format.get_branch_format().get_format_description(), | 675 | """ % (format.get_branch_format().get_format_description(), |
567 | 645 | format.repository_format.get_format_description(), | 676 | format.repository_format.get_format_description(), |
569 | 646 | ), out) | 677 | )).encode(bzrlib.user_encoding), out) |
570 | 647 | self.assertEqual('', err) | 678 | self.assertEqual('', err) |
571 | 648 | 679 | ||
572 | 649 | # Update checkout | 680 | # Update checkout |
573 | @@ -651,8 +682,13 @@ | |||
574 | 651 | self.build_tree(['tree/checkout/b']) | 682 | self.build_tree(['tree/checkout/b']) |
575 | 652 | tree3.add('b') | 683 | tree3.add('b') |
576 | 653 | out, err = self.run_bzr('info tree/checkout --verbose') | 684 | out, err = self.run_bzr('info tree/checkout --verbose') |
577 | 685 | <<<<<<< TREE | ||
578 | 654 | self.assertEqualDiff( | 686 | self.assertEqualDiff( |
579 | 655 | """Checkout (format: unnamed) | 687 | """Checkout (format: unnamed) |
580 | 688 | ======= | ||
581 | 689 | self.assertEqualDiff(( | ||
582 | 690 | """Checkout (format: dirstate) | ||
583 | 691 | >>>>>>> MERGE-SOURCE | ||
584 | 656 | Location: | 692 | Location: |
585 | 657 | checkout root: tree/checkout | 693 | checkout root: tree/checkout |
586 | 658 | checkout of branch: repo/branch | 694 | checkout of branch: repo/branch |
587 | @@ -684,16 +720,22 @@ | |||
588 | 684 | """ % (format.get_branch_format().get_format_description(), | 720 | """ % (format.get_branch_format().get_format_description(), |
589 | 685 | format.repository_format.get_format_description(), | 721 | format.repository_format.get_format_description(), |
590 | 686 | datestring_first, datestring_first, | 722 | datestring_first, datestring_first, |
592 | 687 | ), out) | 723 | )).encode(bzrlib.user_encoding), out) |
593 | 688 | self.assertEqual('', err) | 724 | self.assertEqual('', err) |
594 | 689 | tree3.commit('commit two') | 725 | tree3.commit('commit two') |
595 | 690 | 726 | ||
596 | 691 | # Out of date lightweight checkout | 727 | # Out of date lightweight checkout |
597 | 692 | rev = repo.get_revision(branch1.revision_history()[-1]) | 728 | rev = repo.get_revision(branch1.revision_history()[-1]) |
599 | 693 | datestring_last = format_date(rev.timestamp, rev.timezone) | 729 | datestring_last = format_date(rev.timestamp, rev.timezone, local_weekday=True) |
600 | 694 | out, err = self.run_bzr('info tree/lightcheckout --verbose') | 730 | out, err = self.run_bzr('info tree/lightcheckout --verbose') |
601 | 731 | <<<<<<< TREE | ||
602 | 695 | self.assertEqualDiff( | 732 | self.assertEqualDiff( |
603 | 696 | """Lightweight checkout (format: %s) | 733 | """Lightweight checkout (format: %s) |
604 | 734 | ======= | ||
605 | 735 | self.assertEqualDiff(( | ||
606 | 736 | """Lightweight checkout (format: dirstate or dirstate-tags or \ | ||
607 | 737 | pack-0.92 or rich-root or rich-root-pack) | ||
608 | 738 | >>>>>>> MERGE-SOURCE | ||
609 | 697 | Location: | 739 | Location: |
610 | 698 | light checkout root: tree/lightcheckout | 740 | light checkout root: tree/lightcheckout |
611 | 699 | checkout of branch: repo/branch | 741 | checkout of branch: repo/branch |
612 | @@ -728,12 +770,12 @@ | |||
613 | 728 | """ % (self._repo_strings, format.get_branch_format().get_format_description(), | 770 | """ % (self._repo_strings, format.get_branch_format().get_format_description(), |
614 | 729 | format.repository_format.get_format_description(), | 771 | format.repository_format.get_format_description(), |
615 | 730 | datestring_first, datestring_last, | 772 | datestring_first, datestring_last, |
617 | 731 | ), out) | 773 | )).encode(bzrlib.user_encoding), out) |
618 | 732 | self.assertEqual('', err) | 774 | self.assertEqual('', err) |
619 | 733 | 775 | ||
620 | 734 | # Show info about shared branch | 776 | # Show info about shared branch |
621 | 735 | out, err = self.run_bzr('info repo/branch --verbose') | 777 | out, err = self.run_bzr('info repo/branch --verbose') |
623 | 736 | self.assertEqualDiff( | 778 | self.assertEqualDiff(( |
624 | 737 | """Repository branch (format: dirstate or knit) | 779 | """Repository branch (format: dirstate or knit) |
625 | 738 | Location: | 780 | Location: |
626 | 739 | shared repository: repo | 781 | shared repository: repo |
627 | @@ -755,12 +797,12 @@ | |||
628 | 755 | """ % (format.get_branch_format().get_format_description(), | 797 | """ % (format.get_branch_format().get_format_description(), |
629 | 756 | format.repository_format.get_format_description(), | 798 | format.repository_format.get_format_description(), |
630 | 757 | datestring_first, datestring_last, | 799 | datestring_first, datestring_last, |
632 | 758 | ), out) | 800 | )).encode(bzrlib.user_encoding), out) |
633 | 759 | self.assertEqual('', err) | 801 | self.assertEqual('', err) |
634 | 760 | 802 | ||
635 | 761 | # Show info about repository with revisions | 803 | # Show info about repository with revisions |
636 | 762 | out, err = self.run_bzr('info -v repo') | 804 | out, err = self.run_bzr('info -v repo') |
638 | 763 | self.assertEqualDiff( | 805 | self.assertEqualDiff(( |
639 | 764 | """Shared repository (format: dirstate or dirstate-tags or knit) | 806 | """Shared repository (format: dirstate or dirstate-tags or knit) |
640 | 765 | Location: | 807 | Location: |
641 | 766 | shared repository: repo | 808 | shared repository: repo |
642 | @@ -772,7 +814,7 @@ | |||
643 | 772 | Repository: | 814 | Repository: |
644 | 773 | 2 revisions | 815 | 2 revisions |
645 | 774 | """ % (format.repository_format.get_format_description(), | 816 | """ % (format.repository_format.get_format_description(), |
647 | 775 | ), out) | 817 | )).encode(bzrlib.user_encoding), out) |
648 | 776 | self.assertEqual('', err) | 818 | self.assertEqual('', err) |
649 | 777 | 819 | ||
650 | 778 | def test_info_shared_repository_with_trees(self): | 820 | def test_info_shared_repository_with_trees(self): |
651 | @@ -783,7 +825,7 @@ | |||
652 | 783 | repo = self.make_repository('repo', shared=True, format=format) | 825 | repo = self.make_repository('repo', shared=True, format=format) |
653 | 784 | repo.set_make_working_trees(True) | 826 | repo.set_make_working_trees(True) |
654 | 785 | out, err = self.run_bzr('info -v repo') | 827 | out, err = self.run_bzr('info -v repo') |
656 | 786 | self.assertEqualDiff( | 828 | self.assertEqualDiff(( |
657 | 787 | """Shared repository with trees (format: dirstate or dirstate-tags or knit) | 829 | """Shared repository with trees (format: dirstate or dirstate-tags or knit) |
658 | 788 | Location: | 830 | Location: |
659 | 789 | shared repository: repo | 831 | shared repository: repo |
660 | @@ -797,7 +839,7 @@ | |||
661 | 797 | Repository: | 839 | Repository: |
662 | 798 | 0 revisions | 840 | 0 revisions |
663 | 799 | """ % (format.repository_format.get_format_description(), | 841 | """ % (format.repository_format.get_format_description(), |
665 | 800 | ), out) | 842 | )).encode(bzrlib.user_encoding), out) |
666 | 801 | self.assertEqual('', err) | 843 | self.assertEqual('', err) |
667 | 802 | 844 | ||
668 | 803 | # Create two branches | 845 | # Create two branches |
669 | @@ -808,7 +850,7 @@ | |||
670 | 808 | 850 | ||
671 | 809 | # Empty first branch | 851 | # Empty first branch |
672 | 810 | out, err = self.run_bzr('info repo/branch1 --verbose') | 852 | out, err = self.run_bzr('info repo/branch1 --verbose') |
674 | 811 | self.assertEqualDiff( | 853 | self.assertEqualDiff(( |
675 | 812 | """Repository tree (format: knit) | 854 | """Repository tree (format: knit) |
676 | 813 | Location: | 855 | Location: |
677 | 814 | shared repository: repo | 856 | shared repository: repo |
678 | @@ -837,7 +879,7 @@ | |||
679 | 837 | 0 revisions | 879 | 0 revisions |
680 | 838 | """ % (format.get_branch_format().get_format_description(), | 880 | """ % (format.get_branch_format().get_format_description(), |
681 | 839 | format.repository_format.get_format_description(), | 881 | format.repository_format.get_format_description(), |
683 | 840 | ), out) | 882 | )).encode(bzrlib.user_encoding), out) |
684 | 841 | self.assertEqual('', err) | 883 | self.assertEqual('', err) |
685 | 842 | 884 | ||
686 | 843 | # Update first branch | 885 | # Update first branch |
687 | @@ -846,9 +888,9 @@ | |||
688 | 846 | tree1.add('a') | 888 | tree1.add('a') |
689 | 847 | tree1.commit('commit one') | 889 | tree1.commit('commit one') |
690 | 848 | rev = repo.get_revision(branch1.revision_history()[0]) | 890 | rev = repo.get_revision(branch1.revision_history()[0]) |
692 | 849 | datestring_first = format_date(rev.timestamp, rev.timezone) | 891 | datestring_first = format_date(rev.timestamp, rev.timezone, local_weekday=True) |
693 | 850 | out, err = self.run_bzr('info -v repo/branch1') | 892 | out, err = self.run_bzr('info -v repo/branch1') |
695 | 851 | self.assertEqualDiff( | 893 | self.assertEqualDiff(( |
696 | 852 | """Repository tree (format: knit) | 894 | """Repository tree (format: knit) |
697 | 853 | Location: | 895 | Location: |
698 | 854 | shared repository: repo | 896 | shared repository: repo |
699 | @@ -881,12 +923,12 @@ | |||
700 | 881 | """ % (format.get_branch_format().get_format_description(), | 923 | """ % (format.get_branch_format().get_format_description(), |
701 | 882 | format.repository_format.get_format_description(), | 924 | format.repository_format.get_format_description(), |
702 | 883 | datestring_first, datestring_first, | 925 | datestring_first, datestring_first, |
704 | 884 | ), out) | 926 | )).encode(bzrlib.user_encoding), out) |
705 | 885 | self.assertEqual('', err) | 927 | self.assertEqual('', err) |
706 | 886 | 928 | ||
707 | 887 | # Out of date second branch | 929 | # Out of date second branch |
708 | 888 | out, err = self.run_bzr('info repo/branch2 --verbose') | 930 | out, err = self.run_bzr('info repo/branch2 --verbose') |
710 | 889 | self.assertEqualDiff( | 931 | self.assertEqualDiff(( |
711 | 890 | """Repository tree (format: knit) | 932 | """Repository tree (format: knit) |
712 | 891 | Location: | 933 | Location: |
713 | 892 | shared repository: repo | 934 | shared repository: repo |
714 | @@ -918,14 +960,14 @@ | |||
715 | 918 | 1 revision | 960 | 1 revision |
716 | 919 | """ % (format.get_branch_format().get_format_description(), | 961 | """ % (format.get_branch_format().get_format_description(), |
717 | 920 | format.repository_format.get_format_description(), | 962 | format.repository_format.get_format_description(), |
719 | 921 | ), out) | 963 | )).encode(bzrlib.user_encoding), out) |
720 | 922 | self.assertEqual('', err) | 964 | self.assertEqual('', err) |
721 | 923 | 965 | ||
722 | 924 | # Update second branch | 966 | # Update second branch |
723 | 925 | tree2 = branch2.bzrdir.open_workingtree() | 967 | tree2 = branch2.bzrdir.open_workingtree() |
724 | 926 | tree2.pull(branch1) | 968 | tree2.pull(branch1) |
725 | 927 | out, err = self.run_bzr('info -v repo/branch2') | 969 | out, err = self.run_bzr('info -v repo/branch2') |
727 | 928 | self.assertEqualDiff( | 970 | self.assertEqualDiff(( |
728 | 929 | """Repository tree (format: knit) | 971 | """Repository tree (format: knit) |
729 | 930 | Location: | 972 | Location: |
730 | 931 | shared repository: repo | 973 | shared repository: repo |
731 | @@ -961,12 +1003,12 @@ | |||
732 | 961 | """ % (format.get_branch_format().get_format_description(), | 1003 | """ % (format.get_branch_format().get_format_description(), |
733 | 962 | format.repository_format.get_format_description(), | 1004 | format.repository_format.get_format_description(), |
734 | 963 | datestring_first, datestring_first, | 1005 | datestring_first, datestring_first, |
736 | 964 | ), out) | 1006 | )).encode(bzrlib.user_encoding), out) |
737 | 965 | self.assertEqual('', err) | 1007 | self.assertEqual('', err) |
738 | 966 | 1008 | ||
739 | 967 | # Show info about repository with revisions | 1009 | # Show info about repository with revisions |
740 | 968 | out, err = self.run_bzr('info -v repo') | 1010 | out, err = self.run_bzr('info -v repo') |
742 | 969 | self.assertEqualDiff( | 1011 | self.assertEqualDiff(( |
743 | 970 | """Shared repository with trees (format: dirstate or dirstate-tags or knit) | 1012 | """Shared repository with trees (format: dirstate or dirstate-tags or knit) |
744 | 971 | Location: | 1013 | Location: |
745 | 972 | shared repository: repo | 1014 | shared repository: repo |
746 | @@ -980,7 +1022,7 @@ | |||
747 | 980 | Repository: | 1022 | Repository: |
748 | 981 | 1 revision | 1023 | 1 revision |
749 | 982 | """ % (format.repository_format.get_format_description(), | 1024 | """ % (format.repository_format.get_format_description(), |
751 | 983 | ), | 1025 | )).encode(bzrlib.user_encoding), |
752 | 984 | out) | 1026 | out) |
753 | 985 | self.assertEqual('', err) | 1027 | self.assertEqual('', err) |
754 | 986 | 1028 | ||
755 | @@ -992,7 +1034,7 @@ | |||
756 | 992 | repo = self.make_repository('repo', shared=True, format=format) | 1034 | repo = self.make_repository('repo', shared=True, format=format) |
757 | 993 | repo.set_make_working_trees(True) | 1035 | repo.set_make_working_trees(True) |
758 | 994 | out, err = self.run_bzr('info -v repo') | 1036 | out, err = self.run_bzr('info -v repo') |
760 | 995 | self.assertEqualDiff( | 1037 | self.assertEqualDiff(( |
761 | 996 | """Shared repository with trees (format: dirstate or dirstate-tags or knit) | 1038 | """Shared repository with trees (format: dirstate or dirstate-tags or knit) |
762 | 997 | Location: | 1039 | Location: |
763 | 998 | shared repository: repo | 1040 | shared repository: repo |
764 | @@ -1006,7 +1048,7 @@ | |||
765 | 1006 | Repository: | 1048 | Repository: |
766 | 1007 | 0 revisions | 1049 | 0 revisions |
767 | 1008 | """ % (format.repository_format.get_format_description(), | 1050 | """ % (format.repository_format.get_format_description(), |
769 | 1009 | ), out) | 1051 | )).encode(bzrlib.user_encoding), out) |
770 | 1010 | self.assertEqual('', err) | 1052 | self.assertEqual('', err) |
771 | 1011 | 1053 | ||
772 | 1012 | # Create branch in root of repository | 1054 | # Create branch in root of repository |
773 | @@ -1014,7 +1056,7 @@ | |||
774 | 1014 | branch = control.create_branch() | 1056 | branch = control.create_branch() |
775 | 1015 | control.create_workingtree() | 1057 | control.create_workingtree() |
776 | 1016 | out, err = self.run_bzr('info -v repo') | 1058 | out, err = self.run_bzr('info -v repo') |
778 | 1017 | self.assertEqualDiff( | 1059 | self.assertEqualDiff(( |
779 | 1018 | """Repository tree (format: knit) | 1060 | """Repository tree (format: knit) |
780 | 1019 | Location: | 1061 | Location: |
781 | 1020 | shared repository: repo | 1062 | shared repository: repo |
782 | @@ -1043,7 +1085,7 @@ | |||
783 | 1043 | 0 revisions | 1085 | 0 revisions |
784 | 1044 | """ % (format.get_branch_format().get_format_description(), | 1086 | """ % (format.get_branch_format().get_format_description(), |
785 | 1045 | format.repository_format.get_format_description(), | 1087 | format.repository_format.get_format_description(), |
787 | 1046 | ), out) | 1088 | )).encode(bzrlib.user_encoding), out) |
788 | 1047 | self.assertEqual('', err) | 1089 | self.assertEqual('', err) |
789 | 1048 | 1090 | ||
790 | 1049 | def test_info_repository_hook(self): | 1091 | def test_info_repository_hook(self): |
791 | @@ -1175,8 +1217,13 @@ | |||
792 | 1175 | verbose_info = ' 0 committers\n' | 1217 | verbose_info = ' 0 committers\n' |
793 | 1176 | else: | 1218 | else: |
794 | 1177 | verbose_info = '' | 1219 | verbose_info = '' |
795 | 1220 | <<<<<<< TREE | ||
796 | 1178 | 1221 | ||
797 | 1179 | self.assertEqualDiff( | 1222 | self.assertEqualDiff( |
798 | 1223 | ======= | ||
799 | 1224 | |||
800 | 1225 | self.assertEqualDiff(( | ||
801 | 1226 | >>>>>>> MERGE-SOURCE | ||
802 | 1180 | """%s (format: %s) | 1227 | """%s (format: %s) |
803 | 1181 | Location: | 1228 | Location: |
804 | 1182 | %s%s | 1229 | %s%s |
805 | @@ -1210,7 +1257,7 @@ | |||
806 | 1210 | lco_tree.branch.repository._format.get_format_description(), | 1257 | lco_tree.branch.repository._format.get_format_description(), |
807 | 1211 | expected_lock_output, | 1258 | expected_lock_output, |
808 | 1212 | verbose_info, | 1259 | verbose_info, |
810 | 1213 | ), out) | 1260 | )).encode(bzrlib.user_encoding), out) |
811 | 1214 | self.assertEqual('', err) | 1261 | self.assertEqual('', err) |
812 | 1215 | 1262 | ||
813 | 1216 | def test_info_locking(self): | 1263 | def test_info_locking(self): |
814 | @@ -1345,7 +1392,7 @@ | |||
815 | 1345 | 1392 | ||
816 | 1346 | # U U U | 1393 | # U U U |
817 | 1347 | out, err = self.run_bzr('info -v branch') | 1394 | out, err = self.run_bzr('info -v branch') |
819 | 1348 | self.assertEqualDiff( | 1395 | self.assertEqualDiff(( |
820 | 1349 | """Standalone tree (format: weave) | 1396 | """Standalone tree (format: weave) |
821 | 1350 | Location: | 1397 | Location: |
822 | 1351 | branch root: %s | 1398 | branch root: %s |
823 | @@ -1372,12 +1419,12 @@ | |||
824 | 1372 | Repository: | 1419 | Repository: |
825 | 1373 | 0 revisions | 1420 | 0 revisions |
826 | 1374 | """ % ('branch', tree.branch.repository._format.get_format_description(), | 1421 | """ % ('branch', tree.branch.repository._format.get_format_description(), |
828 | 1375 | ), out) | 1422 | )).encode(bzrlib.user_encoding), out) |
829 | 1376 | self.assertEqual('', err) | 1423 | self.assertEqual('', err) |
830 | 1377 | # L L L | 1424 | # L L L |
831 | 1378 | tree.lock_write() | 1425 | tree.lock_write() |
832 | 1379 | out, err = self.run_bzr('info -v branch') | 1426 | out, err = self.run_bzr('info -v branch') |
834 | 1380 | self.assertEqualDiff( | 1427 | self.assertEqualDiff(( |
835 | 1381 | """Standalone tree (format: weave) | 1428 | """Standalone tree (format: weave) |
836 | 1382 | Location: | 1429 | Location: |
837 | 1383 | branch root: %s | 1430 | branch root: %s |
838 | @@ -1404,7 +1451,7 @@ | |||
839 | 1404 | Repository: | 1451 | Repository: |
840 | 1405 | 0 revisions | 1452 | 0 revisions |
841 | 1406 | """ % ('branch', tree.branch.repository._format.get_format_description(), | 1453 | """ % ('branch', tree.branch.repository._format.get_format_description(), |
843 | 1407 | ), out) | 1454 | )).encode(bzrlib.user_encoding), out) |
844 | 1408 | self.assertEqual('', err) | 1455 | self.assertEqual('', err) |
845 | 1409 | tree.unlock() | 1456 | tree.unlock() |
846 | 1410 | 1457 | ||
847 | 1411 | 1458 | ||
848 | === modified file 'bzrlib/tests/blackbox/test_locale.py' | |||
849 | --- bzrlib/tests/blackbox/test_locale.py 2009-08-17 22:16:49 +0000 | |||
850 | +++ bzrlib/tests/blackbox/test_locale.py 2009-08-31 04:38:49 +0000 | |||
851 | @@ -18,6 +18,7 @@ | |||
852 | 18 | 18 | ||
853 | 19 | import os | 19 | import os |
854 | 20 | import sys | 20 | import sys |
855 | 21 | import locale | ||
856 | 21 | 22 | ||
857 | 22 | from bzrlib.tests import TestCaseWithTransport, TestSkipped | 23 | from bzrlib.tests import TestCaseWithTransport, TestSkipped |
858 | 23 | 24 | ||
859 | @@ -31,12 +32,13 @@ | |||
860 | 31 | raise TestSkipped('Windows does not respond to the LANG' | 32 | raise TestSkipped('Windows does not respond to the LANG' |
861 | 32 | ' env variable') | 33 | ' env variable') |
862 | 33 | 34 | ||
863 | 35 | self.comitter = u'\u062c\u0648\u062c\u0648 Meinel <juju@info.com>' | ||
864 | 36 | self.micro = u'\xb5' | ||
865 | 34 | tree = self.make_branch_and_tree('tree') | 37 | tree = self.make_branch_and_tree('tree') |
866 | 35 | self.build_tree(['tree/a']) | 38 | self.build_tree(['tree/a']) |
867 | 36 | tree.add('a') | 39 | tree.add('a') |
871 | 37 | tree.commit(u'Unicode \xb5 commit', rev_id='r1', | 40 | tree.commit(u'Unicode %s commit' % self.micro, rev_id='r1', |
872 | 38 | committer=u'\u062c\u0648\u062c\u0648' | 41 | committer=self.comitter, |
870 | 39 | u' Meinel <juju@info.com>', | ||
873 | 40 | timestamp=1156451297.96, timezone=0) | 42 | timestamp=1156451297.96, timezone=0) |
874 | 41 | self.tree = tree | 43 | self.tree = tree |
875 | 42 | 44 | ||
876 | @@ -44,7 +46,8 @@ | |||
877 | 44 | out, err = self.run_bzr_subprocess( | 46 | out, err = self.run_bzr_subprocess( |
878 | 45 | '--no-aliases --no-plugins log -q --log-format=long tree', | 47 | '--no-aliases --no-plugins log -q --log-format=long tree', |
879 | 46 | env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none', | 48 | env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none', |
881 | 47 | 'LC_ALL':None, 'LC_CTYPE':None, 'LANGUAGE':None}) | 49 | 'LC_ALL':None, 'LC_CTYPE':None, 'LC_TIME':None, |
882 | 50 | 'LANGUAGE':None}) | ||
883 | 48 | self.assertEqual('', err) | 51 | self.assertEqual('', err) |
884 | 49 | self.assertEqualDiff("""\ | 52 | self.assertEqualDiff("""\ |
885 | 50 | ------------------------------------------------------------ | 53 | ------------------------------------------------------------ |
886 | @@ -56,6 +59,80 @@ | |||
887 | 56 | Unicode ? commit | 59 | Unicode ? commit |
888 | 57 | """, out) | 60 | """, out) |
889 | 58 | 61 | ||
890 | 62 | def _need_locale(self, test_locale, category=None): | ||
891 | 63 | if category is None: | ||
892 | 64 | self._need_locale(test_locale, locale.LC_COLLATE) | ||
893 | 65 | self._need_locale(test_locale, locale.LC_CTYPE) | ||
894 | 66 | self._need_locale(test_locale, locale.LC_MESSAGES) | ||
895 | 67 | self._need_locale(test_locale, locale.LC_MONETARY) | ||
896 | 68 | self._need_locale(test_locale, locale.LC_NUMERIC) | ||
897 | 69 | self._need_locale(test_locale, locale.LC_TIME) | ||
898 | 70 | else: | ||
899 | 71 | try: | ||
900 | 72 | old_locale = locale.setlocale(category, test_locale) | ||
901 | 73 | locale.setlocale(category, old_locale) | ||
902 | 74 | except locale.Error, e: | ||
903 | 75 | raise TestSkipped('Locale %s not supported' % test_locale) | ||
904 | 76 | |||
905 | 77 | def _test_locale(self, test_locale, thursdays, encoding="utf-8"): | ||
906 | 78 | self._need_locale(test_locale) | ||
907 | 79 | if isinstance(thursdays, (str, unicode)): | ||
908 | 80 | thursdays = [thursdays] | ||
909 | 81 | out, err = self.run_bzr_subprocess( | ||
910 | 82 | '--no-aliases --no-plugins info -q -v tree', | ||
911 | 83 | env_changes={'BZR_PROGRESS_BAR':'none', 'LC_ALL':test_locale}) | ||
912 | 84 | self.assertEqual('', err) | ||
913 | 85 | out, err = self.run_bzr_subprocess( | ||
914 | 86 | '--no-aliases --no-plugins log -q --log-format=line tree', | ||
915 | 87 | env_changes={'BZR_PROGRESS_BAR':'none', 'LC_ALL':test_locale}) | ||
916 | 88 | self.assertEqual('', err) | ||
917 | 89 | out, err = self.run_bzr_subprocess( | ||
918 | 90 | '--no-aliases --no-plugins log -q --log-format=short tree', | ||
919 | 91 | env_changes={'BZR_PROGRESS_BAR':'none', 'LC_ALL':test_locale}) | ||
920 | 92 | self.assertEqual('', err) | ||
921 | 93 | out, err = self.run_bzr_subprocess( | ||
922 | 94 | '--no-aliases --no-plugins log -q --log-format=long tree', | ||
923 | 95 | env_changes={'BZR_PROGRESS_BAR':'none', 'LC_ALL':test_locale}) | ||
924 | 96 | self.assertEqual('', err) | ||
925 | 97 | template = """\ | ||
926 | 98 | ------------------------------------------------------------ | ||
927 | 99 | revno: 1 | ||
928 | 100 | committer: %s | ||
929 | 101 | branch nick: tree | ||
930 | 102 | timestamp: %s 2006-08-24 20:28:17 +0000 | ||
931 | 103 | message: | ||
932 | 104 | Unicode %s commit | ||
933 | 105 | """ | ||
934 | 106 | comitter = self.comitter.encode(encoding, 'replace') | ||
935 | 107 | micro = self.micro.encode(encoding, 'replace') | ||
936 | 108 | for thursday in thursdays: | ||
937 | 109 | thursday = thursday.encode(encoding, 'replace') | ||
938 | 110 | if (template % (comitter, thursday, micro)) == out: | ||
939 | 111 | return | ||
940 | 112 | thursday = thursdays[0].encode(encoding, 'replace') | ||
941 | 113 | self.assertEqualDiff(template % (comitter, thursday, micro), out) | ||
942 | 114 | |||
943 | 115 | def test_latin1_de_DE(self): | ||
944 | 116 | self._test_locale("de_DE", "Do", "iso-8859-1") | ||
945 | 117 | |||
946 | 118 | def test_utf8_de_DE(self): | ||
947 | 119 | self._test_locale("de_DE.utf8", "Do") | ||
948 | 120 | |||
949 | 121 | def test_utf8_fr_FR(self): | ||
950 | 122 | self._test_locale("fr_FR.utf8", ["jeu.", "jeu"]) | ||
951 | 123 | |||
952 | 124 | def test_utf8_es_ES(self): | ||
953 | 125 | self._test_locale("es_ES.utf8", "jue") | ||
954 | 126 | |||
955 | 127 | def test_utf8_ja_JP(self): | ||
956 | 128 | self._test_locale("ja_JP.utf8", u"\u6728") | ||
957 | 129 | |||
958 | 130 | def test_euc_ja_JP(self): | ||
959 | 131 | self._test_locale("ja_JP.EUC-JP", u"\u6728", "EUC-JP") | ||
960 | 132 | |||
961 | 133 | def test_utf8_ru_RU(self): | ||
962 | 134 | self._test_locale("ru_RU.utf8", u"\u0427\u0442\u0432") | ||
963 | 135 | |||
964 | 59 | def test_log_BOGUS(self): | 136 | def test_log_BOGUS(self): |
965 | 60 | out, err = self.run_bzr_subprocess( | 137 | out, err = self.run_bzr_subprocess( |
966 | 61 | '--no-aliases --no-plugins log -q --log-format=long tree', | 138 | '--no-aliases --no-plugins log -q --log-format=long tree', |
967 | 62 | 139 | ||
968 | === modified file 'bzrlib/tests/test_log.py' | |||
969 | --- bzrlib/tests/test_log.py 2009-08-19 01:44:41 +0000 | |||
970 | +++ bzrlib/tests/test_log.py 2009-08-31 04:38:49 +0000 | |||
971 | @@ -17,6 +17,7 @@ | |||
972 | 17 | import os | 17 | import os |
973 | 18 | from cStringIO import StringIO | 18 | from cStringIO import StringIO |
974 | 19 | 19 | ||
975 | 20 | <<<<<<< TREE | ||
976 | 20 | from bzrlib import ( | 21 | from bzrlib import ( |
977 | 21 | errors, | 22 | errors, |
978 | 22 | log, | 23 | log, |
979 | @@ -47,6 +48,38 @@ | |||
980 | 47 | To simplify testing we save logged revisions here rather than actually | 48 | To simplify testing we save logged revisions here rather than actually |
981 | 48 | formatting anything, so that we can precisely check the result without | 49 | formatting anything, so that we can precisely check the result without |
982 | 49 | being dependent on the formatting. | 50 | being dependent on the formatting. |
983 | 51 | ======= | ||
984 | 52 | from bzrlib import log | ||
985 | 53 | from bzrlib.tests import TestCase, TestCaseWithTransport | ||
986 | 54 | from bzrlib.log import (show_log, | ||
987 | 55 | get_view_revisions, | ||
988 | 56 | LogRevision, | ||
989 | 57 | LogFormatter, | ||
990 | 58 | LongLogFormatter, | ||
991 | 59 | ShortLogFormatter, | ||
992 | 60 | LineLogFormatter) | ||
993 | 61 | from bzrlib.branch import Branch | ||
994 | 62 | from bzrlib.errors import ( | ||
995 | 63 | BzrCommandError, | ||
996 | 64 | InvalidRevisionNumber, | ||
997 | 65 | ) | ||
998 | 66 | from bzrlib.revision import Revision | ||
999 | 67 | from bzrlib.revisionspec import ( | ||
1000 | 68 | RevisionInfo, | ||
1001 | 69 | RevisionSpec, | ||
1002 | 70 | ) | ||
1003 | 71 | from bzrlib.osutils import format_date | ||
1004 | 72 | |||
1005 | 73 | |||
1006 | 74 | class LogCatcher(LogFormatter): | ||
1007 | 75 | """Pull log messages into list rather than displaying them. | ||
1008 | 76 | |||
1009 | 77 | For ease of testing we save log messages here rather than actually | ||
1010 | 78 | formatting them, so that we can precisely check the result without | ||
1011 | 79 | being too dependent on the exact formatting. | ||
1012 | 80 | |||
1013 | 81 | We should also test the LogFormatter. | ||
1014 | 82 | >>>>>>> MERGE-SOURCE | ||
1015 | 50 | """ | 83 | """ |
1016 | 51 | 84 | ||
1017 | 52 | supports_delta = True | 85 | supports_delta = True |
1018 | @@ -493,24 +526,39 @@ | |||
1019 | 493 | timestamp=1132711707, | 526 | timestamp=1132711707, |
1020 | 494 | timezone=36000, | 527 | timezone=36000, |
1021 | 495 | committer='Lorem Ipsum <test@example.com>') | 528 | committer='Lorem Ipsum <test@example.com>') |
1022 | 529 | <<<<<<< TREE | ||
1023 | 496 | logfile = file('out.tmp', 'w+') | 530 | logfile = file('out.tmp', 'w+') |
1024 | 497 | formatter = log.LongLogFormatter(to_file=logfile) | 531 | formatter = log.LongLogFormatter(to_file=logfile) |
1025 | 498 | log.show_log(b, formatter, verbose=True) | 532 | log.show_log(b, formatter, verbose=True) |
1026 | 533 | ======= | ||
1027 | 534 | logfile = self.make_utf8_encoded_stringio() | ||
1028 | 535 | formatter = LongLogFormatter(to_file=logfile) | ||
1029 | 536 | show_log(b, formatter, verbose=True) | ||
1030 | 537 | >>>>>>> MERGE-SOURCE | ||
1031 | 499 | logfile.flush() | 538 | logfile.flush() |
1032 | 500 | logfile.seek(0) | 539 | logfile.seek(0) |
1033 | 501 | log_contents = logfile.read() | 540 | log_contents = logfile.read() |
1034 | 541 | <<<<<<< TREE | ||
1035 | 502 | self.assertEqualDiff('''\ | 542 | self.assertEqualDiff('''\ |
1036 | 543 | ======= | ||
1037 | 544 | self.assertEqualDiff(log_contents, ('''\ | ||
1038 | 545 | >>>>>>> MERGE-SOURCE | ||
1039 | 503 | ------------------------------------------------------------ | 546 | ------------------------------------------------------------ |
1040 | 504 | revno: 1 | 547 | revno: 1 |
1041 | 505 | committer: Lorem Ipsum <test@example.com> | 548 | committer: Lorem Ipsum <test@example.com> |
1042 | 506 | branch nick: test_verbose_log | 549 | branch nick: test_verbose_log |
1044 | 507 | timestamp: Wed 2005-11-23 12:08:27 +1000 | 550 | timestamp: %s |
1045 | 508 | message: | 551 | message: |
1046 | 509 | add a | 552 | add a |
1047 | 510 | added: | 553 | added: |
1048 | 511 | a | 554 | a |
1049 | 555 | <<<<<<< TREE | ||
1050 | 512 | ''', | 556 | ''', |
1051 | 513 | log_contents) | 557 | log_contents) |
1052 | 558 | ======= | ||
1053 | 559 | ''' % (format_date(1132711707, 36000, local_weekday=True) | ||
1054 | 560 | )).encode('utf-8')) | ||
1055 | 561 | >>>>>>> MERGE-SOURCE | ||
1056 | 514 | 562 | ||
1057 | 515 | def test_merges_are_indented_by_level(self): | 563 | def test_merges_are_indented_by_level(self): |
1058 | 516 | wt = self.make_branch_and_tree('parent') | 564 | wt = self.make_branch_and_tree('parent') |
1059 | @@ -628,14 +676,20 @@ | |||
1060 | 628 | wt = self.make_branch_and_tree('.') | 676 | wt = self.make_branch_and_tree('.') |
1061 | 629 | b = make_commits_with_trailing_newlines(wt) | 677 | b = make_commits_with_trailing_newlines(wt) |
1062 | 630 | sio = self.make_utf8_encoded_stringio() | 678 | sio = self.make_utf8_encoded_stringio() |
1063 | 679 | <<<<<<< TREE | ||
1064 | 631 | lf = log.LongLogFormatter(to_file=sio) | 680 | lf = log.LongLogFormatter(to_file=sio) |
1065 | 632 | log.show_log(b, lf) | 681 | log.show_log(b, lf) |
1066 | 633 | self.assertEqualDiff("""\ | 682 | self.assertEqualDiff("""\ |
1067 | 683 | ======= | ||
1068 | 684 | lf = LongLogFormatter(to_file=sio) | ||
1069 | 685 | show_log(b, lf) | ||
1070 | 686 | self.assertEqualDiff(sio.getvalue(), ("""\ | ||
1071 | 687 | >>>>>>> MERGE-SOURCE | ||
1072 | 634 | ------------------------------------------------------------ | 688 | ------------------------------------------------------------ |
1073 | 635 | revno: 3 | 689 | revno: 3 |
1074 | 636 | committer: Joe Foo <joe@foo.com> | 690 | committer: Joe Foo <joe@foo.com> |
1075 | 637 | branch nick: test | 691 | branch nick: test |
1077 | 638 | timestamp: Mon 2005-11-21 09:32:56 -0600 | 692 | timestamp: %s |
1078 | 639 | message: | 693 | message: |
1079 | 640 | single line with trailing newline | 694 | single line with trailing newline |
1080 | 641 | ------------------------------------------------------------ | 695 | ------------------------------------------------------------ |
1081 | @@ -643,7 +697,7 @@ | |||
1082 | 643 | author: Joe Bar <joe@bar.com> | 697 | author: Joe Bar <joe@bar.com> |
1083 | 644 | committer: Joe Foo <joe@foo.com> | 698 | committer: Joe Foo <joe@foo.com> |
1084 | 645 | branch nick: test | 699 | branch nick: test |
1086 | 646 | timestamp: Mon 2005-11-21 09:27:22 -0600 | 700 | timestamp: %s |
1087 | 647 | message: | 701 | message: |
1088 | 648 | multiline | 702 | multiline |
1089 | 649 | log | 703 | log |
1090 | @@ -652,11 +706,18 @@ | |||
1091 | 652 | revno: 1 | 706 | revno: 1 |
1092 | 653 | committer: Joe Foo <joe@foo.com> | 707 | committer: Joe Foo <joe@foo.com> |
1093 | 654 | branch nick: test | 708 | branch nick: test |
1095 | 655 | timestamp: Mon 2005-11-21 09:24:15 -0600 | 709 | timestamp: %s |
1096 | 656 | message: | 710 | message: |
1097 | 657 | simple log message | 711 | simple log message |
1098 | 712 | <<<<<<< TREE | ||
1099 | 658 | """, | 713 | """, |
1100 | 659 | sio.getvalue()) | 714 | sio.getvalue()) |
1101 | 715 | ======= | ||
1102 | 716 | """ % (format_date(1132587176.835228920, -6*3600, local_weekday=True), | ||
1103 | 717 | format_date(1132586842.411175966, -6*3600, local_weekday=True), | ||
1104 | 718 | format_date(1132586655.459960938, -6*3600, local_weekday=True) | ||
1105 | 719 | )).encode('utf-8')) | ||
1106 | 720 | >>>>>>> MERGE-SOURCE | ||
1107 | 660 | 721 | ||
1108 | 661 | def test_author_in_log(self): | 722 | def test_author_in_log(self): |
1109 | 662 | """Log includes the author name if it's set in | 723 | """Log includes the author name if it's set in |
1110 | @@ -671,6 +732,7 @@ | |||
1111 | 671 | timestamp=1132711707, | 732 | timestamp=1132711707, |
1112 | 672 | timezone=36000, | 733 | timezone=36000, |
1113 | 673 | committer='Lorem Ipsum <test@example.com>', | 734 | committer='Lorem Ipsum <test@example.com>', |
1114 | 735 | <<<<<<< TREE | ||
1115 | 674 | authors=['John Doe <jdoe@example.com>', | 736 | authors=['John Doe <jdoe@example.com>', |
1116 | 675 | 'Jane Rey <jrey@example.com>']) | 737 | 'Jane Rey <jrey@example.com>']) |
1117 | 676 | sio = StringIO() | 738 | sio = StringIO() |
1118 | @@ -1010,6 +1072,27 @@ | |||
1119 | 1010 | 1072 | ||
1120 | 1011 | 1073 | ||
1121 | 1012 | class TestLineLogFormatter(tests.TestCaseWithTransport): | 1074 | class TestLineLogFormatter(tests.TestCaseWithTransport): |
1122 | 1075 | ======= | ||
1123 | 1076 | author='John Doe <jdoe@example.com>') | ||
1124 | 1077 | sio = self.make_utf8_encoded_stringio() | ||
1125 | 1078 | formatter = LongLogFormatter(to_file=sio) | ||
1126 | 1079 | show_log(b, formatter) | ||
1127 | 1080 | self.assertEqualDiff(sio.getvalue(), ('''\ | ||
1128 | 1081 | ------------------------------------------------------------ | ||
1129 | 1082 | revno: 1 | ||
1130 | 1083 | author: John Doe <jdoe@example.com> | ||
1131 | 1084 | committer: Lorem Ipsum <test@example.com> | ||
1132 | 1085 | branch nick: test_author_log | ||
1133 | 1086 | timestamp: %s | ||
1134 | 1087 | message: | ||
1135 | 1088 | add a | ||
1136 | 1089 | ''' % (format_date(1132711707, 36000, local_weekday=True) | ||
1137 | 1090 | )).encode('utf-8')) | ||
1138 | 1091 | |||
1139 | 1092 | |||
1140 | 1093 | |||
1141 | 1094 | class TestLineLogFormatter(TestCaseWithTransport): | ||
1142 | 1095 | >>>>>>> MERGE-SOURCE | ||
1143 | 1013 | 1096 | ||
1144 | 1014 | def test_line_log(self): | 1097 | def test_line_log(self): |
1145 | 1015 | """Line log should show revno | 1098 | """Line log should show revno |
1146 | 1016 | 1099 | ||
1147 | === modified file 'bzrlib/tests/test_selftest.py' | |||
1148 | --- bzrlib/tests/test_selftest.py 2009-08-26 23:25:28 +0000 | |||
1149 | +++ bzrlib/tests/test_selftest.py 2009-08-31 04:38:49 +0000 | |||
1150 | @@ -865,6 +865,44 @@ | |||
1151 | 865 | self.assertEqual(lines[1], ' foo') | 865 | self.assertEqual(lines[1], ' foo') |
1152 | 866 | self.assertEqual(2, len(lines)) | 866 | self.assertEqual(2, len(lines)) |
1153 | 867 | 867 | ||
1154 | 868 | <<<<<<< TREE | ||
1155 | 869 | ======= | ||
1156 | 870 | def test_text_report_known_failure(self): | ||
1157 | 871 | # text test output formatting | ||
1158 | 872 | pb = MockProgress() | ||
1159 | 873 | result = bzrlib.tests.TextTestResult( | ||
1160 | 874 | None, | ||
1161 | 875 | descriptions=0, | ||
1162 | 876 | verbosity=1, | ||
1163 | 877 | pb=pb, | ||
1164 | 878 | ) | ||
1165 | 879 | test = self.get_passing_test() | ||
1166 | 880 | # this seeds the state to handle reporting the test. | ||
1167 | 881 | result.startTest(test) | ||
1168 | 882 | # the err parameter has the shape: | ||
1169 | 883 | # (class, exception object, traceback) | ||
1170 | 884 | # KnownFailures dont get their tracebacks shown though, so we | ||
1171 | 885 | # can skip that. | ||
1172 | 886 | err = (KnownFailure, KnownFailure('foo'), None) | ||
1173 | 887 | result.report_known_failure(test, err) | ||
1174 | 888 | self.assertEqual( | ||
1175 | 889 | [ | ||
1176 | 890 | ('update', '[1 in 0s] passing_test', None, None), | ||
1177 | 891 | ('note', '%s: %s\n %s\n', ('XFAIL', 'passing_test', err[1])) | ||
1178 | 892 | ], | ||
1179 | 893 | pb.calls) | ||
1180 | 894 | # known_failures should be printed in the summary, so if we run a test | ||
1181 | 895 | # after there are some known failures, the update prefix should match | ||
1182 | 896 | # this. | ||
1183 | 897 | result.known_failure_count = 3 | ||
1184 | 898 | test.run(result) | ||
1185 | 899 | self.assertEqual( | ||
1186 | 900 | [ | ||
1187 | 901 | ('update', '[2 in 0s] passing_test', None, None), | ||
1188 | 902 | ], | ||
1189 | 903 | pb.calls[2:]) | ||
1190 | 904 | |||
1191 | 905 | >>>>>>> MERGE-SOURCE | ||
1192 | 868 | def get_passing_test(self): | 906 | def get_passing_test(self): |
1193 | 869 | """Return a test object that can't be run usefully.""" | 907 | """Return a test object that can't be run usefully.""" |
1194 | 870 | def passing_test(): | 908 | def passing_test(): |
1195 | 871 | 909 | ||
1196 | === modified file 'bzrlib/timestamp.py' | |||
1197 | --- bzrlib/timestamp.py 2009-03-23 14:59:43 +0000 | |||
1198 | +++ bzrlib/timestamp.py 2009-08-31 04:38:49 +0000 | |||
1199 | @@ -19,7 +19,6 @@ | |||
1200 | 19 | 19 | ||
1201 | 20 | from bzrlib import osutils | 20 | from bzrlib import osutils |
1202 | 21 | 21 | ||
1203 | 22 | |||
1204 | 23 | def format_highres_date(t, offset=0): | 22 | def format_highres_date(t, offset=0): |
1205 | 24 | """Format a date, such that it includes higher precision in the | 23 | """Format a date, such that it includes higher precision in the |
1206 | 25 | seconds field. | 24 | seconds field. |
1207 | @@ -35,11 +34,11 @@ | |||
1208 | 35 | 34 | ||
1209 | 36 | >>> from bzrlib.osutils import format_date | 35 | >>> from bzrlib.osutils import format_date |
1210 | 37 | >>> format_date(1120153132.350850105, 0) | 36 | >>> format_date(1120153132.350850105, 0) |
1212 | 38 | 'Thu 2005-06-30 17:38:52 +0000' | 37 | u'Thu 2005-06-30 17:38:52 +0000' |
1213 | 39 | >>> format_highres_date(1120153132.350850105, 0) | 38 | >>> format_highres_date(1120153132.350850105, 0) |
1214 | 40 | 'Thu 2005-06-30 17:38:52.350850105 +0000' | 39 | 'Thu 2005-06-30 17:38:52.350850105 +0000' |
1215 | 41 | >>> format_date(1120153132.350850105, -5*3600) | 40 | >>> format_date(1120153132.350850105, -5*3600) |
1217 | 42 | 'Thu 2005-06-30 12:38:52 -0500' | 41 | u'Thu 2005-06-30 12:38:52 -0500' |
1218 | 43 | >>> format_highres_date(1120153132.350850105, -5*3600) | 42 | >>> format_highres_date(1120153132.350850105, -5*3600) |
1219 | 44 | 'Thu 2005-06-30 12:38:52.350850105 -0500' | 43 | 'Thu 2005-06-30 12:38:52.350850105 -0500' |
1220 | 45 | >>> format_highres_date(1120153132.350850105, 7200) | 44 | >>> format_highres_date(1120153132.350850105, 7200) |
Digging through old list archives, it seems this branch has been mostly obsoleted by now, as a number of individual features have been spliced out and merged. I'm quoting merging bzr.dev revision numbers and mailing list subjects:
3518: setlocale mini (#128496) Feature
3528: Remove unused call to format_date
3529: Improved UnicodeFilename
3754: local weekday support
The only remaining issue seems to be from a mailing list thread with subject "More robust handling of encoding issues in tests". I've just updated it to match current bzr.dev and pushed it to lp:~gagern/bzr/encodingSafeTests