146
167
if not branch.repository.has_revision(new_last_revision_id):
147
168
return FailedSmartServerResponse(
148
169
('NoSuchRevision', new_last_revision_id))
150
172
return SuccessfulSmartServerResponse(('ok',))
153
175
class SmartServerBranchRequestSetLastRevisionEx(SmartServerSetTipRequest):
155
177
def do_tip_change_with_locked_branch(self, branch, new_last_revision_id,
156
178
allow_divergence, allow_overwrite_descendant):
157
179
"""Set the last revision of the branch.
161
183
:param new_last_revision_id: the revision ID to set as the last
163
185
:param allow_divergence: A flag. If non-zero, change the revision ID