~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Robert Collins
  • Date: 2009-03-24 07:09:11 UTC
  • mto: This revision was merged to the branch mainline in revision 4199.
  • Revision ID: robertc@robertcollins.net-20090324070911-w59etn9q3f9xj4fu
Cache ghosts when we can get them from a RemoteRepository in get_parent_map.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1247
1247
        for parents in parents_map.itervalues():
1248
1248
            result_parents.update(parents)
1249
1249
        stop_keys = result_parents.difference(start_set)
 
1250
        # We don't need to send ghosts back to the server as a position to
 
1251
        # stop either.
 
1252
        stop_keys.difference_update(self._unstacked_provider.missing_keys)
1250
1253
        included_keys = start_set.intersection(result_parents)
1251
1254
        start_set.difference_update(included_keys)
1252
1255
        recipe = ('manual', start_set, stop_keys, len(parents_map))
1257
1260
                raise ValueError(
1258
1261
                    "key %r not a plain string" % (key,))
1259
1262
        verb = 'Repository.get_parent_map'
1260
 
        args = (path,) + tuple(keys)
 
1263
        args = (path, 'include-missing:') + tuple(keys)
1261
1264
        try:
1262
1265
            response = self._call_with_body_bytes_expecting_body(
1263
1266
                verb, args, body)
1291
1294
                if len(d) > 1:
1292
1295
                    revision_graph[d[0]] = d[1:]
1293
1296
                else:
1294
 
                    # No parents - so give the Graph result (NULL_REVISION,).
1295
 
                    revision_graph[d[0]] = (NULL_REVISION,)
 
1297
                    # No parents:
 
1298
                    if d[0].startswith('missing:'):
 
1299
                        revid = d[0][8:]
 
1300
                        self._unstacked_provider.note_missing_key(revid)
 
1301
                    else:
 
1302
                        # no parents - so give the Graph result
 
1303
                        # (NULL_REVISION,).
 
1304
                        revision_graph[d[0]] = (NULL_REVISION,)
1296
1305
            return revision_graph
1297
1306
 
1298
1307
    @needs_read_lock