~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2009-05-05 15:31:34 UTC
  • mto: (4343.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4344.
  • Revision ID: v.ladeuil+lp@free.fr-20090505153134-q4bp4is9gywsmzrv
Clean up test for log formats.

* bzrlib/tests/blackbox/test_logformats.py:
Update tests to actual style.

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 __init__(self, backing_transport, root_client_path='/'):
109
 
        SmartServerLockedBranchRequest.__init__(
110
 
            self, backing_transport, root_client_path)
111
 
        self.locked = False
112
 
        
113
 
    def do_with_locked_branch(self, branch):
114
 
        """Call _set_tags_bytes for a branch.
115
 
 
116
 
        New in 1.18.
117
 
        """
118
 
        # We need to keep this branch locked until we get a body with the tags
119
 
        # bytes.
120
 
        self.branch = branch
121
 
        self.branch.lock_write()
122
 
        self.locked = True
123
 
 
124
 
    def do_body(self, bytes):
125
 
        self.branch._set_tags_bytes(bytes)
126
 
        return SuccessfulSmartServerResponse(())
127
 
 
128
 
    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
 
        if not self.locked:
132
 
            # We never acquired the branch successfully in the first place, so
133
 
            # there's nothing more to do.
134
 
            return
135
 
        try:
136
 
            return SmartServerLockedBranchRequest.do_end(self)
137
 
        finally:
138
 
            # Only try unlocking if we locked successfully in the first place
139
 
            self.branch.unlock()
140
 
 
141
 
 
142
106
class SmartServerBranchRequestGetStackedOnURL(SmartServerBranchRequest):
143
107
 
144
108
    def do_with_branch(self, branch):