~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-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
    def do(self, path, *args):
34
34
        """Execute a request for a branch at path.
35
 
    
 
35
 
36
36
        All Branch requests take a path to the branch as their first argument.
37
37
 
38
38
        If the branch is a branch reference, NotBranchError is raised.
74
74
 
75
75
 
76
76
class SmartServerBranchGetConfigFile(SmartServerBranchRequest):
77
 
    
 
77
 
78
78
    def do_with_branch(self, branch):
79
79
        """Return the content of branch.conf
80
 
        
 
80
 
81
81
        The body is not utf8 decoded - its the literal bytestream from disk.
82
82
        """
83
83
        # This was at one time called by RemoteBranchLockableFiles
112
112
 
113
113
 
114
114
class SmartServerBranchRequestLastRevisionInfo(SmartServerBranchRequest):
115
 
    
 
115
 
116
116
    def do_with_branch(self, branch):
117
117
        """Return branch.last_revision_info().
118
 
        
 
118
 
119
119
        The revno is encoded in decimal, the revision_id is encoded as utf8.
120
120
        """
121
121
        revno, last_revision = branch.last_revision_info()
138
138
 
139
139
 
140
140
class SmartServerBranchRequestSetLastRevision(SmartServerSetTipRequest):
141
 
    
 
141
 
142
142
    def do_tip_change_with_locked_branch(self, branch, new_last_revision_id):
143
143
        if new_last_revision_id == 'null:':
144
144
            branch.set_revision_history([])
152
152
 
153
153
 
154
154
class SmartServerBranchRequestSetLastRevisionEx(SmartServerSetTipRequest):
155
 
    
 
155
 
156
156
    def do_tip_change_with_locked_branch(self, branch, new_last_revision_id,
157
157
            allow_divergence, allow_overwrite_descendant):
158
158
        """Set the last revision of the branch.
159
159
 
160
160
        New in 1.6.
161
 
        
 
161
 
162
162
        :param new_last_revision_id: the revision ID to set as the last
163
163
            revision of the branch.
164
164
        :param allow_divergence: A flag.  If non-zero, change the revision ID
205
205
 
206
206
    New in bzrlib 1.4.
207
207
    """
208
 
    
 
208
 
209
209
    def do_tip_change_with_locked_branch(self, branch, new_revno,
210
210
            new_last_revision_id):
211
211
        try:
217
217
 
218
218
 
219
219
class SmartServerBranchRequestLockWrite(SmartServerBranchRequest):
220
 
    
 
220
 
221
221
    def do_with_branch(self, branch, branch_token='', repo_token=''):
222
222
        if branch_token == '':
223
223
            branch_token = None
263
263
        branch.dont_leave_lock_in_place()
264
264
        branch.unlock()
265
265
        return SuccessfulSmartServerResponse(('ok',))
266
 
        
 
266