/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

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
            try:
129
129
                branch_token = branch.lock_write(token=branch_token)
130
130
            finally:
 
131
                # this leaves the repository with 1 lock
131
132
                branch.repository.unlock()
132
133
        except errors.LockContention:
133
134
            return FailedSmartServerResponse(('LockContention',))
137
138
            return FailedSmartServerResponse(('UnlockableTransport',))
138
139
        except errors.LockFailed, e:
139
140
            return FailedSmartServerResponse(('LockFailed', str(e.lock), str(e.why)))
140
 
        branch.repository.leave_lock_in_place()
 
141
        if repo_token is None:
 
142
            repo_token = ''
 
143
        else:
 
144
            branch.repository.leave_lock_in_place()
141
145
        branch.leave_lock_in_place()
142
146
        branch.unlock()
143
147
        return SuccessfulSmartServerResponse(('ok', branch_token, repo_token))
154
158
                branch.repository.unlock()
155
159
        except errors.TokenMismatch:
156
160
            return FailedSmartServerResponse(('TokenMismatch',))
157
 
        branch.repository.dont_leave_lock_in_place()
 
161
        if repo_token:
 
162
            branch.repository.dont_leave_lock_in_place()
158
163
        branch.dont_leave_lock_in_place()
159
164
        branch.unlock()
160
165
        return SuccessfulSmartServerResponse(('ok',))