Show More
@@ -454,7 +454,7 b' def action_parser(user_log, feed=False):' | |||||
454 |
|
454 | |||
455 | if isinstance(rev, BaseChangeset): |
|
455 | if isinstance(rev, BaseChangeset): | |
456 | lbl = 'r%s:%s' % (rev.revision, rev.short_id) |
|
456 | lbl = 'r%s:%s' % (rev.revision, rev.short_id) | |
457 |
_url = url('changeset_home', repo_name=repo_name, |
|
457 | _url = url('changeset_home', repo_name=repo_name, | |
458 | revision=rev.raw_id) |
|
458 | revision=rev.raw_id) | |
459 | title = tooltip(rev.message) |
|
459 | title = tooltip(rev.message) | |
460 | else: |
|
460 | else: |
@@ -309,7 +309,7 b' def age(prevdate):' | |||||
309 | for num, length in [(5, 60), (4, 60), (3, 24)]: # seconds, minutes, hours |
|
309 | for num, length in [(5, 60), (4, 60), (3, 24)]: # seconds, minutes, hours | |
310 | part = order[num] |
|
310 | part = order[num] | |
311 | carry_part = order[num - 1] |
|
311 | carry_part = order[num - 1] | |
312 |
|
312 | |||
313 | if deltas[part] < 0: |
|
313 | if deltas[part] < 0: | |
314 | deltas[part] += length |
|
314 | deltas[part] += length | |
315 | deltas[carry_part] -= 1 |
|
315 | deltas[carry_part] -= 1 | |
@@ -323,13 +323,13 b' def age(prevdate):' | |||||
323 | deltas['day'] += 29 |
|
323 | deltas['day'] += 29 | |
324 | else: |
|
324 | else: | |
325 | deltas['day'] += month_lengths[prevdate.month - 1] |
|
325 | deltas['day'] += month_lengths[prevdate.month - 1] | |
326 |
|
326 | |||
327 | deltas['month'] -= 1 |
|
327 | deltas['month'] -= 1 | |
328 |
|
328 | |||
329 | if deltas['month'] < 0: |
|
329 | if deltas['month'] < 0: | |
330 | deltas['month'] += 12 |
|
330 | deltas['month'] += 12 | |
331 | deltas['year'] -= 1 |
|
331 | deltas['year'] -= 1 | |
332 |
|
332 | |||
333 | # Format the result |
|
333 | # Format the result | |
334 | fmt_funcs = { |
|
334 | fmt_funcs = { | |
335 | 'year': lambda d: ungettext(u'%d year', '%d years', d) % d, |
|
335 | 'year': lambda d: ungettext(u'%d year', '%d years', d) % d, | |
@@ -339,21 +339,21 b' def age(prevdate):' | |||||
339 | 'minute': lambda d: ungettext(u'%d minute', '%d minutes', d) % d, |
|
339 | 'minute': lambda d: ungettext(u'%d minute', '%d minutes', d) % d, | |
340 | 'second': lambda d: ungettext(u'%d second', '%d seconds', d) % d, |
|
340 | 'second': lambda d: ungettext(u'%d second', '%d seconds', d) % d, | |
341 | } |
|
341 | } | |
342 |
|
342 | |||
343 | for i, part in enumerate(order): |
|
343 | for i, part in enumerate(order): | |
344 | value = deltas[part] |
|
344 | value = deltas[part] | |
345 | if value == 0: |
|
345 | if value == 0: | |
346 | continue |
|
346 | continue | |
347 |
|
347 | |||
348 | if i < 5: |
|
348 | if i < 5: | |
349 | sub_part = order[i + 1] |
|
349 | sub_part = order[i + 1] | |
350 | sub_value = deltas[sub_part] |
|
350 | sub_value = deltas[sub_part] | |
351 | else: |
|
351 | else: | |
352 | sub_value = 0 |
|
352 | sub_value = 0 | |
353 |
|
353 | |||
354 | if sub_value == 0: |
|
354 | if sub_value == 0: | |
355 | return _(u'%s ago') % fmt_funcs[part](value) |
|
355 | return _(u'%s ago') % fmt_funcs[part](value) | |
356 |
|
356 | |||
357 | return _(u'%s and %s ago') % (fmt_funcs[part](value), |
|
357 | return _(u'%s and %s ago') % (fmt_funcs[part](value), | |
358 | fmt_funcs[sub_part](sub_value)) |
|
358 | fmt_funcs[sub_part](sub_value)) | |
359 |
|
359 |
@@ -94,7 +94,7 b' class GitRepository(BaseRepository):' | |||||
94 | if isinstance(cmd, basestring): |
|
94 | if isinstance(cmd, basestring): | |
95 | cmd = [cmd] |
|
95 | cmd = [cmd] | |
96 | _str_cmd = True |
|
96 | _str_cmd = True | |
97 |
|
97 | |||
98 | gitenv = os.environ |
|
98 | gitenv = os.environ | |
99 | gitenv['GIT_CONFIG_NOGLOBAL'] = '1' |
|
99 | gitenv['GIT_CONFIG_NOGLOBAL'] = '1' | |
100 |
|
100 |
@@ -82,4 +82,4 b'' | |||||
82 | </div> |
|
82 | </div> | |
83 | </div> |
|
83 | </div> | |
84 | ${h.end_form()} |
|
84 | ${h.end_form()} | |
85 | </div> No newline at end of file |
|
85 | </div> |
@@ -200,8 +200,8 b' class TestFilesController(TestController' | |||||
200 |
|
200 | |||
201 | self.assertEqual(response.status, '200 OK') |
|
201 | self.assertEqual(response.status, '200 OK') | |
202 | heads = [ |
|
202 | heads = [ | |
203 |
('Pragma', 'no-cache'), |
|
203 | ('Pragma', 'no-cache'), | |
204 |
('Cache-Control', 'no-cache'), |
|
204 | ('Cache-Control', 'no-cache'), | |
205 | ('Content-Disposition', 'attachment; filename=%s' % filename), |
|
205 | ('Content-Disposition', 'attachment; filename=%s' % filename), | |
206 | ('Content-Type', '%s; charset=utf-8' % info[0]), |
|
206 | ('Content-Type', '%s; charset=utf-8' % info[0]), | |
207 | ] |
|
207 | ] | |
@@ -213,7 +213,7 b' class TestFilesController(TestController' | |||||
213 | for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: |
|
213 | for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: | |
214 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext |
|
214 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext | |
215 |
|
215 | |||
216 |
response = self.app.get(url(controller='files', |
|
216 | response = self.app.get(url(controller='files', | |
217 | action='archivefile', |
|
217 | action='archivefile', | |
218 | repo_name=HG_REPO, |
|
218 | repo_name=HG_REPO, | |
219 | fname=fname)) |
|
219 | fname=fname)) |
General Comments 0
You need to be logged in to leave comments.
Login now