~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Robert Collins
  • Date: 2008-03-28 03:54:40 UTC
  • mto: This revision was merged to the branch mainline in revision 3313.
  • Revision ID: robertc@robertcollins.net-20080328035440-4cflvryqujresn2g
Reduce code duplication as per review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    SmartServerRequest,
32
32
    SuccessfulSmartServerResponse,
33
33
    )
 
34
from bzrlib.repository import _strip_NULL_ghosts
34
35
from bzrlib import revision as _mod_revision
35
36
 
36
37
 
210
211
        transitive_ids = set()
211
212
        map(transitive_ids.update, list(search))
212
213
        parent_map = graph.get_parent_map(transitive_ids)
213
 
        revision_graph = {}
214
 
        if _mod_revision.NULL_REVISION in parent_map:
215
 
            del parent_map[_mod_revision.NULL_REVISION]
216
 
        for key, parents in parent_map.iteritems():
217
 
            revision_graph[key] = tuple(parent for parent in parents if
218
 
                parent in parent_map)
 
214
        revision_graph = _strip_NULL_ghosts(parent_map)
219
215
        if revision_id and revision_id not in revision_graph:
220
216
            # Note that we return an empty body, rather than omitting the body.
221
217
            # This way the client knows that it can always expect to find a body