~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

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