~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-07-16 10:47:45 UTC
  • mfrom: (6027.1.7 deprecations)
  • Revision ID: pqm@pqm.ubuntu.com-20110716104745-8n8mgnn7ld7dcf8w
(vila) Remove commands, diff and trace deprecated stuff (Vincent Ladeuil)

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