/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-22 10:55:35 UTC
  • mto: This revision was merged to the branch mainline in revision 4573.
  • Revision ID: andrew.bennetts@canonical.com-20090722105535-t2iv2j8zbj2230q2
Add Branch.set_tags_bytes RPC, with HPSS call count acceptance test.  Also fixes serialisation of LockDir, and uses external_url() in LockDir's repr and contention message.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        return SuccessfulSmartServerResponse((bytes,))
104
104
 
105
105
 
 
106
class SmartServerBranchSetTagsBytes(SmartServerLockedBranchRequest):
 
107
 
 
108
    def do_with_locked_branch(self, branch):
 
109
        # We need to keep this branch locked until we get a body with the tags
 
110
        # bytes.
 
111
        self.branch = branch
 
112
        self.branch.lock_write()
 
113
 
 
114
    def do_body(self, bytes):
 
115
        self.branch._set_tags_bytes(bytes)
 
116
        return SuccessfulSmartServerResponse(())
 
117
 
 
118
    def do_end(self):
 
119
        try:
 
120
            return SmartServerLockedBranchRequest.do_end(self)
 
121
        finally:
 
122
            # XXX: should only try unlock if we locked successfully!
 
123
            self.branch.unlock()
 
124
 
 
125
 
106
126
class SmartServerBranchRequestGetStackedOnURL(SmartServerBranchRequest):
107
127
 
108
128
    def do_with_branch(self, branch):