/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-23 07:37:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4573.
  • Revision ID: andrew.bennetts@canonical.com-20090723073705-l9shzmc4ix74zv18
Handle failures more gracefully.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
 
106
106
class SmartServerBranchSetTagsBytes(SmartServerLockedBranchRequest):
107
107
 
108
 
    def __init__(self, backing_transport, root_client_path='/', jail_root=None):
 
108
    def __init__(self, backing_transport, root_client_path='/'):
109
109
        SmartServerLockedBranchRequest.__init__(
110
 
            self, backing_transport, root_client_path, jail_root)
 
110
            self, backing_transport, root_client_path)
111
111
        self.locked = False
112
112
        
113
113
    def do_with_locked_branch(self, branch):
114
 
        """Call _set_tags_bytes for a branch.
115
 
 
116
 
        New in 1.18.
117
 
        """
118
114
        # We need to keep this branch locked until we get a body with the tags
119
115
        # bytes.
120
116
        self.branch = branch
126
122
        return SuccessfulSmartServerResponse(())
127
123
 
128
124
    def do_end(self):
129
 
        # TODO: this request shouldn't have to do this housekeeping manually.
130
 
        # Some of this logic probably belongs in a base class.
131
125
        if not self.locked:
132
126
            # We never acquired the branch successfully in the first place, so
133
127
            # there's nothing more to do.
 
128
            # XXX: perhaps it should be easier for request classes to do
 
129
            # nothing further if they have raised an error previously?  It
 
130
            # seems a bit messy to require them to keep track of this state.
134
131
            return
135
132
        try:
136
133
            return SmartServerLockedBranchRequest.do_end(self)