~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-25 04:44:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5695.
  • Revision ID: andrew.bennetts@canonical.com-20110225044453-2ig5en0bi0uukre6
Fix final bzr-loom test by adding RemoteBranch.heads_to_fetch that can ask the remote branch for the heads to fetch (but uses the cheaper default logic if it knows the remote format has an identical heads_to_fetch as Branch.heads_to_fetch).

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
            self.branch.unlock()
143
143
 
144
144
 
 
145
class SmartServerBranchHeadsToFetch(SmartServerBranchRequest):
 
146
 
 
147
    def do_with_branch(self, branch):
 
148
        """Return the heads-to-fetch for a Branch as two bencoded lists.
 
149
        
 
150
        See Branch.heads_to_fetch.
 
151
 
 
152
        New in 2.4.
 
153
        """
 
154
        must_fetch, if_present_fetch = branch.heads_to_fetch()
 
155
        return SuccessfulSmartServerResponse(
 
156
            (list(must_fetch), list(if_present_fetch)))
 
157
 
 
158
 
145
159
class SmartServerBranchRequestGetStackedOnURL(SmartServerBranchRequest):
146
160
 
147
161
    def do_with_branch(self, branch):