~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: John Arbash Meinel
  • Date: 2013-05-19 14:29:37 UTC
  • mfrom: (6437.63.9 2.5)
  • mto: (6437.63.10 2.5)
  • mto: This revision was merged to the branch mainline in revision 6575.
  • Revision ID: john@arbash-meinel.com-20130519142937-21ykz2n2y2f22za9
Merge in the actual 2.5 branch. It seems I failed before

Show diffs side-by-side

added added

removed removed

Lines of Context:
3129
3129
        return a_bzrdir.open_branch(name=name, 
3130
3130
            ignore_fallbacks=ignore_fallbacks)
3131
3131
 
3132
 
    def _vfs_initialize(self, a_bzrdir, name, append_revisions_only):
 
3132
    def _vfs_initialize(self, a_bzrdir, name, append_revisions_only,
 
3133
                        repository=None):
3133
3134
        # Initialisation when using a local bzrdir object, or a non-vfs init
3134
3135
        # method is not available on the server.
3135
3136
        # self._custom_format is always set - the start of initialize ensures
3137
3138
        if isinstance(a_bzrdir, RemoteBzrDir):
3138
3139
            a_bzrdir._ensure_real()
3139
3140
            result = self._custom_format.initialize(a_bzrdir._real_bzrdir,
3140
 
                name=name, append_revisions_only=append_revisions_only)
 
3141
                name=name, append_revisions_only=append_revisions_only,
 
3142
                repository=repository)
3141
3143
        else:
3142
3144
            # We assume the bzrdir is parameterised; it may not be.
3143
3145
            result = self._custom_format.initialize(a_bzrdir, name=name,
3144
 
                append_revisions_only=append_revisions_only)
 
3146
                append_revisions_only=append_revisions_only,
 
3147
                repository=repository)
3145
3148
        if (isinstance(a_bzrdir, RemoteBzrDir) and
3146
3149
            not isinstance(result, RemoteBranch)):
3147
3150
            result = RemoteBranch(a_bzrdir, a_bzrdir.find_repository(), result,
3164
3167
        # Being asked to create on a non RemoteBzrDir:
3165
3168
        if not isinstance(a_bzrdir, RemoteBzrDir):
3166
3169
            return self._vfs_initialize(a_bzrdir, name=name,
3167
 
                append_revisions_only=append_revisions_only)
 
3170
                append_revisions_only=append_revisions_only,
 
3171
                repository=repository)
3168
3172
        medium = a_bzrdir._client._medium
3169
3173
        if medium._is_remote_before((1, 13)):
3170
3174
            return self._vfs_initialize(a_bzrdir, name=name,
3171
 
                append_revisions_only=append_revisions_only)
 
3175
                append_revisions_only=append_revisions_only,
 
3176
                repository=repository)
3172
3177
        # Creating on a remote bzr dir.
3173
3178
        # 2) try direct creation via RPC
3174
3179
        path = a_bzrdir._path_for_remote_call(a_bzrdir._client)
3182
3187
            # Fallback - use vfs methods
3183
3188
            medium._remember_remote_is_before((1, 13))
3184
3189
            return self._vfs_initialize(a_bzrdir, name=name,
3185
 
                    append_revisions_only=append_revisions_only)
 
3190
                    append_revisions_only=append_revisions_only,
 
3191
                    repository=repository)
3186
3192
        if response[0] != 'ok':
3187
3193
            raise errors.UnexpectedSmartServerResponse(response)
3188
3194
        # Turn the response into a RemoteRepository object.
3867
3873
            target, overwrite=overwrite, stop_revision=stop_revision, lossy=lossy,
3868
3874
            _override_hook_source_branch=self)
3869
3875
 
 
3876
    def peek_lock_mode(self):
 
3877
        return self._lock_mode
 
3878
 
3870
3879
    def is_locked(self):
3871
3880
        return self._lock_count >= 1
3872
3881