~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Aaron Bentley
  • Date: 2008-04-24 04:58:42 UTC
  • mfrom: (3377 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3380.
  • Revision ID: aaron@aaronbentley.com-20080424045842-0cajl9v6s4u52kaw
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        return SuccessfulSmartServerResponse(('ok',))
124
124
 
125
125
 
 
126
class SmartServerBranchRequestSetLastRevisionInfo(
 
127
    SmartServerLockedBranchRequest):
 
128
    """Branch.set_last_revision_info.  Sets the revno and the revision ID of
 
129
    the specified branch.
 
130
 
 
131
    New in bzrlib 1.4.
 
132
    """
 
133
    
 
134
    def do_with_locked_branch(self, branch, new_revno, new_last_revision_id):
 
135
        try:
 
136
            branch.set_last_revision_info(int(new_revno), new_last_revision_id)
 
137
        except errors.NoSuchRevision:
 
138
            return FailedSmartServerResponse(
 
139
                ('NoSuchRevision', new_last_revision_id))
 
140
        return SuccessfulSmartServerResponse(('ok',))
 
141
 
 
142
 
126
143
class SmartServerBranchRequestLockWrite(SmartServerBranchRequest):
127
144
    
128
145
    def do_with_branch(self, branch, branch_token='', repo_token=''):