~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/wholehistory.py

[rs=me] update to loggerhead trunk to get the possible fix for 118625

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    # Filter ghosts, and null:
33
33
    if NULL_REVISION in revision_graph:
34
34
        del revision_graph[NULL_REVISION]
35
 
    for key, parents in revision_graph.items():
 
35
    for key, parents in revision_graph.iteritems():
36
36
        revision_graph[key] = tuple(parent for parent in parents if parent
37
37
            in revision_graph)
38
38
    return revision_graph
48
48
    last_revid = branch.last_revision()
49
49
 
50
50
    log = logging.getLogger('loggerhead.%s' %
51
 
                            branch.get_config().get_nickname())
 
51
                            (branch.get_config().get_nickname(),))
52
52
 
53
53
    graph = branch.repository.get_graph()
54
 
    parent_map = dict(((key, value) for key, value in
55
 
         graph.iter_ancestry([last_revid]) if value is not None))
 
54
    parent_map = dict((key, value) for key, value in
 
55
        graph.iter_ancestry([last_revid]) if value is not None)
56
56
 
57
57
    _revision_graph = _strip_NULL_ghosts(parent_map)
58
58
 
72
72
        _rev_indices[revid] = len(_rev_info)
73
73
        _rev_info.append([(seq, revid, merge_depth, revno_str, end_of_merge), (), parents])
74
74
 
75
 
    for revid in _revision_graph.keys():
 
75
    for revid in _revision_graph.iterkeys():
76
76
        if _rev_info[_rev_indices[revid]][0][2] == 0:
77
77
            continue
78
78
        for parent in _revision_graph[revid]:
80
80
            if revid not in c[1]:
81
81
                c[1] = c[1] + (revid,)
82
82
 
83
 
    log.info('built revision graph cache: %r secs' % (time.time() - z))
 
83
    log.info('built revision graph cache: %r secs' % (time.time() - z,))
84
84
 
85
85
    return (_rev_info, _rev_indices)