branch --stacked records the absolute url
Bug #264975 reported by
Martin Pool
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned | ||
Breezy |
Triaged
|
Medium
|
Unassigned |
Bug Description
Following on from bug 261315, it looks like 'bzr branch --stacked' saves the absolute url of the stacked-on branch. This works poorly if you later access the branch over a different protocol.
This might be similar to bug 250418.
Changed in bzr: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
tags: | added: stacking |
tags: | added: check-for-breezy |
tags: | removed: check-for-breezy |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
To post a comment you must log in.
IIRC, the only pointer that uses a relative path is 'parent'. We use (Branch. set_parent) : InvalidURL( url,
"Urls must be 7-bit ascii, "
"use bzrlib. urlutils. escape" ) relative_ url(self. base, url)
if url is not None:
if isinstance(url, unicode):
try:
url = url.encode('ascii')
except UnicodeEncodeError:
raise errors.
url = urlutils.
And in Branch.get_parent: get_parent. """ parent_ location( ) startswith( '/'): local_path_ to_url( parent. decode( 'utf8') ) join(self. base[:- 1], parent) InvalidURLJoin, e: InaccessiblePar ent(parent, self.base)
def get_parent(self):
"""See Branch.
parent = self._get_
if parent is None:
return parent
# This is an old-format absolute path to a local branch
# turn it into a url
if parent.
parent = urlutils.
try:
return urlutils.
except errors.
raise errors.
There is a bit of extra handling, because at one point parent could be a filesystem path, rather than a file:/// url. But now it is always a url, often a relative one. (Often it is *too* relative on the local filesystem, as doing: one/location /completely/ different/ path
bzr branch /path/to/
will still use a "relative" path between them.
)
Anyway, it wouldn't be too hard to duplicate 'urlutils. relative_ url()' and 'urlutils.join()' in the stacking code. It technically is incompatible, as older clients wouldn't be able to find the stacked location for a relative url.