~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

(gz) Create working tree at specified revision when doing a local push
 (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
384
384
            self._real_store = _mod_config.ControlStore(self.bzrdir)
385
385
 
386
386
    def external_url(self):
387
 
        return urlutils.join(self.branch.user_url, 'control.conf')
 
387
        return self.bzrdir.user_url
388
388
 
389
389
    def _load_content(self):
390
390
        medium = self.bzrdir._client._medium
3117
3117
        return a_bzrdir.open_branch(name=name, 
3118
3118
            ignore_fallbacks=ignore_fallbacks)
3119
3119
 
3120
 
    def _vfs_initialize(self, a_bzrdir, name, append_revisions_only,
3121
 
                        repository=None):
 
3120
    def _vfs_initialize(self, a_bzrdir, name, append_revisions_only):
3122
3121
        # Initialisation when using a local bzrdir object, or a non-vfs init
3123
3122
        # method is not available on the server.
3124
3123
        # self._custom_format is always set - the start of initialize ensures
3126
3125
        if isinstance(a_bzrdir, RemoteBzrDir):
3127
3126
            a_bzrdir._ensure_real()
3128
3127
            result = self._custom_format.initialize(a_bzrdir._real_bzrdir,
3129
 
                name=name, append_revisions_only=append_revisions_only,
3130
 
                repository=repository)
 
3128
                name=name, append_revisions_only=append_revisions_only)
3131
3129
        else:
3132
3130
            # We assume the bzrdir is parameterised; it may not be.
3133
3131
            result = self._custom_format.initialize(a_bzrdir, name=name,
3134
 
                append_revisions_only=append_revisions_only,
3135
 
                repository=repository)
 
3132
                append_revisions_only=append_revisions_only)
3136
3133
        if (isinstance(a_bzrdir, RemoteBzrDir) and
3137
3134
            not isinstance(result, RemoteBranch)):
3138
3135
            result = RemoteBranch(a_bzrdir, a_bzrdir.find_repository(), result,
3155
3152
        # Being asked to create on a non RemoteBzrDir:
3156
3153
        if not isinstance(a_bzrdir, RemoteBzrDir):
3157
3154
            return self._vfs_initialize(a_bzrdir, name=name,
3158
 
                append_revisions_only=append_revisions_only,
3159
 
                repository=repository)
 
3155
                append_revisions_only=append_revisions_only)
3160
3156
        medium = a_bzrdir._client._medium
3161
3157
        if medium._is_remote_before((1, 13)):
3162
3158
            return self._vfs_initialize(a_bzrdir, name=name,
3163
 
                append_revisions_only=append_revisions_only,
3164
 
                repository=repository)
 
3159
                append_revisions_only=append_revisions_only)
3165
3160
        # Creating on a remote bzr dir.
3166
3161
        # 2) try direct creation via RPC
3167
3162
        path = a_bzrdir._path_for_remote_call(a_bzrdir._client)
3175
3170
            # Fallback - use vfs methods
3176
3171
            medium._remember_remote_is_before((1, 13))
3177
3172
            return self._vfs_initialize(a_bzrdir, name=name,
3178
 
                    append_revisions_only=append_revisions_only,
3179
 
                    repository=repository)
 
3173
                    append_revisions_only=append_revisions_only)
3180
3174
        if response[0] != 'ok':
3181
3175
            raise errors.UnexpectedSmartServerResponse(response)
3182
3176
        # Turn the response into a RemoteRepository object.
3257
3251
        self._real_store = None
3258
3252
 
3259
3253
    def external_url(self):
3260
 
        return urlutils.join(self.branch.user_url, 'branch.conf')
 
3254
        return self.branch.user_url
3261
3255
 
3262
3256
    def _load_content(self):
3263
3257
        path = self.branch._remote_path()
3851
3845
            target, overwrite=overwrite, stop_revision=stop_revision, lossy=lossy,
3852
3846
            _override_hook_source_branch=self)
3853
3847
 
3854
 
    def peek_lock_mode(self):
3855
 
        return self._lock_mode
3856
 
 
3857
3848
    def is_locked(self):
3858
3849
        return self._lock_count >= 1
3859
3850