~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/util.py

MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
log = logging.getLogger("loggerhead.controllers")
39
39
 
 
40
def fix_year(year):
 
41
    if year < 70:
 
42
        year += 2000
 
43
    if year < 100:
 
44
        year += 1900
 
45
    return year
 
46
 
40
47
# Display of times.
41
48
 
42
49
# date_day -- just the day
349
356
 
350
357
    navigation.prev_page_revid = get_offset(-1 * navigation.pagesize)
351
358
    navigation.next_page_revid = get_offset(1 * navigation.pagesize)
352
 
    prev_page_revno = navigation.branch._history.get_revno(
 
359
    prev_page_revno = navigation.branch.history.get_revno(
353
360
            navigation.prev_page_revid)
354
 
    next_page_revno = navigation.branch._history.get_revno(
 
361
    next_page_revno = navigation.branch.history.get_revno(
355
362
            navigation.next_page_revid)
 
363
    start_revno = navigation.branch._history.get_revno(navigation.start_revid)
356
364
 
357
365
    params = { 'filter_file_id': navigation.filter_file_id }
358
366
    if getattr(navigation, 'query', None) is not None:
359
367
        params['q'] = navigation.query
360
368
 
 
369
    if getattr(navigation, 'start_revid', None) is not None:
 
370
        params['start_revid'] = start_revno
 
371
 
361
372
    if navigation.prev_page_revid:
362
 
        navigation.prev_page_url = navigation.branch.url([navigation.scan_url,
363
 
            prev_page_revno], **params)
 
373
        navigation.prev_page_url = navigation.branch.context_url(
 
374
            [navigation.scan_url, prev_page_revno], **params)
364
375
    if navigation.next_page_revid:
365
 
        navigation.next_page_url = navigation.branch.url([navigation.scan_url,
366
 
            next_page_revno], **params)
 
376
        navigation.next_page_url = navigation.branch.context_url(
 
377
            [navigation.scan_url, next_page_revno], **params)
367
378
 
368
379
 
369
380
def log_exception(log):