~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-01 06:34:34 UTC
  • mfrom: (4226.1.4 Branch.set_stacked_on_url)
  • Revision ID: pqm@pqm.ubuntu.com-20090401063434-motksin95y4undi6
(robertc) Lift up Branch7.set_stacked_on_url to Branch,
        allowing reuse by RemoteBranch and decreasing round trips for pushing
        new stacked branches. (Robert Collins, Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1935
1935
        except (errors.NotStacked, errors.UnstackableBranchFormat,
1936
1936
            errors.UnstackableRepositoryFormat), e:
1937
1937
            return
1938
 
        # it's relative to this branch...
1939
 
        fallback_url = urlutils.join(self.base, fallback_url)
1940
 
        transports = [self.bzrdir.root_transport]
1941
 
        stacked_on = branch.Branch.open(fallback_url,
1942
 
                                        possible_transports=transports)
1943
 
        self.repository.add_fallback_repository(stacked_on.repository)
 
1938
        self._activate_fallback_location(fallback_url)
1944
1939
 
1945
1940
    def _get_real_transport(self):
1946
1941
        # if we try vfs access, return the real branch's vfs transport
2288
2283
            self._ensure_real()
2289
2284
            return self._real_branch._set_parent_location(url)
2290
2285
 
2291
 
    def set_stacked_on_url(self, stacked_location):
2292
 
        """Set the URL this branch is stacked against.
2293
 
 
2294
 
        :raises UnstackableBranchFormat: If the branch does not support
2295
 
            stacking.
2296
 
        :raises UnstackableRepositoryFormat: If the repository does not support
2297
 
            stacking.
2298
 
        """
2299
 
        self._ensure_real()
2300
 
        return self._real_branch.set_stacked_on_url(stacked_location)
2301
 
 
2302
2286
    @needs_write_lock
2303
2287
    def pull(self, source, overwrite=False, stop_revision=None,
2304
2288
             **kwargs):