~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-08 11:20:31 UTC
  • mto: This revision was merged to the branch mainline in revision 5844.
  • Revision ID: jelmer@samba.org-20110508112031-dqa1cw1gjhqsj2zr
Move vf-specific gather_stats bits to vf_repository.

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):
218
232
 
219
233
    def do_tip_change_with_locked_branch(self, branch, new_last_revision_id):
220
234
        if new_last_revision_id == 'null:':
221
 
            branch.set_revision_history([])
 
235
            branch._set_revision_history([])
222
236
        else:
223
237
            if not branch.repository.has_revision(new_last_revision_id):
224
238
                return FailedSmartServerResponse(
225
239
                    ('NoSuchRevision', new_last_revision_id))
226
 
            branch.set_revision_history(branch._lefthand_history(
 
240
            branch._set_revision_history(branch._lefthand_history(
227
241
                new_last_revision_id, None, None))
228
242
        return SuccessfulSmartServerResponse(('ok',))
229
243