~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Andrew Bennetts
  • Date: 2008-05-21 11:53:44 UTC
  • mto: (3452.2.9 inter-remote-pack)
  • mto: This revision was merged to the branch mainline in revision 3511.
  • Revision ID: andrew.bennetts@canonical.com-20080521115344-oofrx0k7yht4564t
Avoid necessarily calling get_parent_map when pushing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
        return SuccessfulSmartServerResponse(('ok', ), '\n'.join(lines))
228
228
 
229
229
 
 
230
class SmartServerRepositoryGraphHeads(SmartServerRepositoryRequest):
 
231
 
 
232
    def do_repository_request(self, repository, *keys):
 
233
        repository.lock_read()
 
234
        try:
 
235
            graph = repository.get_graph()
 
236
            heads = tuple(graph.heads(keys))
 
237
        finally:
 
238
            repository.unlock()
 
239
        return SuccessfulSmartServerResponse(heads)
 
240
 
 
241
 
230
242
class SmartServerRequestHasRevision(SmartServerRepositoryRequest):
231
243
 
232
244
    def do_repository_request(self, repository, revision_id):