~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-27 22:29:55 UTC
  • mto: (3735.39.2 clean)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090327222955-utifmfm888zerixt
Implement apply_delta_to_source which doesn't have to malloc another string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
        The body is not utf8 decoded - its the literal bytestream from disk.
82
82
        """
 
83
        # This was at one time called by RemoteBranchLockableFiles
 
84
        # intercepting access to this file; as of 1.5 it is not called by the
 
85
        # client but retained for compatibility.  It may be called again to
 
86
        # allow the client to get the configuration without needing vfs
 
87
        # access.
83
88
        try:
84
89
            content = branch._transport.get_bytes('branch.conf')
85
90
        except errors.NoSuchFile:
148
153
            return FailedSmartServerResponse(('TipChangeRejected', msg))
149
154
 
150
155
 
151
 
class SmartServerBranchRequestSetConfigOption(SmartServerLockedBranchRequest):
152
 
    """Set an option in the branch configuration."""
153
 
 
154
 
    def do_with_locked_branch(self, branch, value, name, section):
155
 
        if not section:
156
 
            section = None
157
 
        branch._get_config().set_option(value.decode('utf8'), name, section)
158
 
        return SuccessfulSmartServerResponse(())
159
 
 
160
 
 
161
156
class SmartServerBranchRequestSetLastRevision(SmartServerSetTipRequest):
162
157
 
163
158
    def do_tip_change_with_locked_branch(self, branch, new_last_revision_id):
237
232
        return SuccessfulSmartServerResponse(('ok',))
238
233
 
239
234
 
240
 
class SmartServerBranchRequestSetParentLocation(SmartServerLockedBranchRequest):
241
 
    """Set the parent location for a branch.
242
 
    
243
 
    Takes a location to set, which must be utf8 encoded.
244
 
    """
245
 
 
246
 
    def do_with_locked_branch(self, branch, location):
247
 
        branch._set_parent_location(location)
248
 
        return SuccessfulSmartServerResponse(())
249
 
 
250
 
 
251
235
class SmartServerBranchRequestLockWrite(SmartServerBranchRequest):
252
236
 
253
237
    def do_with_branch(self, branch, branch_token='', repo_token=''):