/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/remote.py

remove all trailing whitespace from bzr source

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
            return self._client.call(method, *args)
52
52
        except errors.ErrorFromSmartServer, err:
53
53
            self._translate_error(err, **err_context)
54
 
        
 
54
 
55
55
    def _call_expecting_body(self, method, *args, **err_context):
56
56
        try:
57
57
            return self._client.call_expecting_body(method, *args)
58
58
        except errors.ErrorFromSmartServer, err:
59
59
            self._translate_error(err, **err_context)
60
 
        
 
60
 
61
61
    def _call_with_body_bytes_expecting_body(self, method, args, body_bytes,
62
62
                                             **err_context):
63
63
        try:
65
65
                method, args, body_bytes)
66
66
        except errors.ErrorFromSmartServer, err:
67
67
            self._translate_error(err, **err_context)
68
 
        
 
68
 
69
69
# Note: RemoteBzrDirFormat is in bzrdir.py
70
70
 
71
71
class RemoteBzrDir(BzrDir, _RpcHelper):
172
172
            # a branch reference, use the existing BranchReference logic.
173
173
            format = BranchReferenceFormat()
174
174
            return format.open(self, _found=True, location=reference_url)
175
 
                
 
175
 
176
176
    def open_repository(self):
177
177
        path = self._path_for_remote_call(self._client)
178
178
        verb = 'BzrDir.find_repositoryV2'
265
265
            return prior_repo._real_repository._format.initialize(
266
266
                a_bzrdir, shared=shared)
267
267
        return a_bzrdir.create_repository(shared=shared)
268
 
    
 
268
 
269
269
    def open(self, a_bzrdir):
270
270
        if not isinstance(a_bzrdir, RemoteBzrDir):
271
271
            raise AssertionError('%r is not a RemoteBzrDir' % (a_bzrdir,))
296
296
 
297
297
    def __init__(self, remote_bzrdir, format, real_repository=None, _client=None):
298
298
        """Create a RemoteRepository instance.
299
 
        
 
299
 
300
300
        :param remote_bzrdir: The bzrdir hosting this repository.
301
301
        :param format: The RemoteFormat object to use.
302
302
        :param real_repository: If not None, a local implementation of the
341
341
 
342
342
    def abort_write_group(self, suppress_errors=False):
343
343
        """Complete a write group on the decorated repository.
344
 
        
 
344
 
345
345
        Smart methods peform operations in a single step so this api
346
346
        is not really applicable except as a compatibility thunk
347
347
        for older plugins that don't use e.g. the CommitBuilder
355
355
 
356
356
    def commit_write_group(self):
357
357
        """Complete a write group on the decorated repository.
358
 
        
 
358
 
359
359
        Smart methods peform operations in a single step so this api
360
360
        is not really applicable except as a compatibility thunk
361
361
        for older plugins that don't use e.g. the CommitBuilder
429
429
        for line in lines:
430
430
            d = tuple(line.split())
431
431
            revision_graph[d[0]] = d[1:]
432
 
            
 
432
 
433
433
        return revision_graph
434
434
 
435
435
    def has_revision(self, revision_id):
616
616
 
617
617
    def start_write_group(self):
618
618
        """Start a write group on the decorated repository.
619
 
        
 
619
 
620
620
        Smart methods peform operations in a single step so this api
621
621
        is not really applicable except as a compatibility thunk
622
622
        for older plugins that don't use e.g. the CommitBuilder
671
671
 
672
672
    def _get_tarball(self, compression):
673
673
        """Return a TemporaryFile containing a repository tarball.
674
 
        
 
674
 
675
675
        Returns None if the server does not support sending tarballs.
676
676
        """
677
677
        import tempfile
723
723
 
724
724
    def add_fallback_repository(self, repository):
725
725
        """Add a repository to use for looking up data not held locally.
726
 
        
 
726
 
727
727
        :param repository: A repository.
728
728
        """
729
729
        # XXX: At the moment the RemoteRepository will allow fallbacks
798
798
    @needs_read_lock
799
799
    def search_missing_revision_ids(self, other, revision_id=None, find_ghosts=True):
800
800
        """Return the revision ids that other has that this does not.
801
 
        
 
801
 
802
802
        These are returned in topological order.
803
803
 
804
804
        revision_id: only return revision ids included by revision_id.
839
839
        self._ensure_real()
840
840
        return self._real_repository._get_versioned_file_checker(
841
841
            revisions, revision_versions_cache)
842
 
        
 
842
 
843
843
    def iter_files_bytes(self, desired_files):
844
844
        """See Repository.iter_file_bytes.
845
845
        """
1008
1008
    def reconcile(self, other=None, thorough=False):
1009
1009
        self._ensure_real()
1010
1010
        return self._real_repository.reconcile(other=other, thorough=thorough)
1011
 
        
 
1011
 
1012
1012
    def all_revision_ids(self):
1013
1013
        self._ensure_real()
1014
1014
        return self._real_repository.all_revision_ids()
1015
 
    
 
1015
 
1016
1016
    @needs_read_lock
1017
1017
    def get_deltas_for_revisions(self, revisions):
1018
1018
        self._ensure_real()
1219
1219
 
1220
1220
class RemoteBranchLockableFiles(LockableFiles):
1221
1221
    """A 'LockableFiles' implementation that talks to a smart server.
1222
 
    
 
1222
 
1223
1223
    This is not a public interface class.
1224
1224
    """
1225
1225
 
1245
1245
        self._matchingbzrdir.set_branch_format(self)
1246
1246
 
1247
1247
    def __eq__(self, other):
1248
 
        return (isinstance(other, RemoteBranchFormat) and 
 
1248
        return (isinstance(other, RemoteBranchFormat) and
1249
1249
            self.__dict__ == other.__dict__)
1250
1250
 
1251
1251
    def get_format_description(self):
1393
1393
        too, in fact doing so might harm performance.
1394
1394
        """
1395
1395
        super(RemoteBranch, self)._clear_cached_state()
1396
 
        
 
1396
 
1397
1397
    @property
1398
1398
    def control_files(self):
1399
1399
        # Defer actually creating RemoteBranchLockableFiles until its needed,
1463
1463
            raise errors.UnexpectedSmartServerResponse(response)
1464
1464
        ok, branch_token, repo_token = response
1465
1465
        return branch_token, repo_token
1466
 
            
 
1466
 
1467
1467
    def lock_write(self, token=None):
1468
1468
        if not self._lock_mode:
1469
1469
            # Lock the branch and repo in one remote call.
1612
1612
    def get_parent(self):
1613
1613
        self._ensure_real()
1614
1614
        return self._real_branch.get_parent()
1615
 
        
 
1615
 
1616
1616
    def set_parent(self, url):
1617
1617
        self._ensure_real()
1618
1618
        return self._real_branch.set_parent(url)
1619
 
        
 
1619
 
1620
1620
    def set_stacked_on_url(self, stacked_location):
1621
1621
        """Set the URL this branch is stacked against.
1622
1622