103
103
return SuccessfulSmartServerResponse((bytes,))
106
class SmartServerBranchSetTagsBytes(SmartServerLockedBranchRequest):
108
def __init__(self, backing_transport, root_client_path='/', jail_root=None):
109
SmartServerLockedBranchRequest.__init__(
110
self, backing_transport, root_client_path, jail_root)
113
def do_with_locked_branch(self, branch):
114
"""Call _set_tags_bytes for a branch.
118
# We need to keep this branch locked until we get a body with the tags
121
self.branch.lock_write()
124
def do_body(self, bytes):
125
self.branch._set_tags_bytes(bytes)
126
return SuccessfulSmartServerResponse(())
129
# TODO: this request shouldn't have to do this housekeeping manually.
130
# Some of this logic probably belongs in a base class.
132
# We never acquired the branch successfully in the first place, so
133
# there's nothing more to do.
136
return SmartServerLockedBranchRequest.do_end(self)
138
# Only try unlocking if we locked successfully in the first place
142
106
class SmartServerBranchRequestGetStackedOnURL(SmartServerBranchRequest):
144
108
def do_with_branch(self, branch):