Merge lp:~tzeentch-gm/bzr-colo/1044975-remote-cw-base-fix into lp:bzr-colo

Proposed by Michael Gliwinski
Status: Needs review
Proposed branch: lp:~tzeentch-gm/bzr-colo/1044975-remote-cw-base-fix
Merge into: lp:bzr-colo
Diff against target: 23 lines (+5/-1)
1 file modified
colocated.py (+5/-1)
To merge this branch: bzr merge lp:~tzeentch-gm/bzr-colo/1044975-remote-cw-base-fix
Reviewer Review Type Date Requested Status
Neil Martinsen-Burrell Pending
Review via email: mp+122407@code.launchpad.net

Description of the change

This fixes the problem described in #1044975

The bug only occurs when using a remote URL (i.e. non-localhost) so I'm not sure how to test it. Let me know if you have any suggestions and if this approach is OK (all existing tests pass for me).

To post a comment you must log in.

Unmerged revisions

121. By Michael Gliwinski

Consider a remote ColocatedWorkspace as having no working tree.

Otherwise the remote working tree's branch is used to calculate repo location, but since the tree references this branch with a local (file:) URL, this causes repo_location to be a file: URL where it should be remote.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'colocated.py'
2--- colocated.py 2011-11-28 05:03:30 +0000
3+++ colocated.py 2012-09-02 13:17:19 +0000
4@@ -29,6 +29,7 @@
5 osutils,
6 )
7
8+from bzrlib.transport.local import LocalTransport
9 from trace import mutter
10
11 COLOCATED_LOCATION = osutils.pathjoin(u'.bzr', u'branches')
12@@ -53,7 +54,10 @@
13 a_bzrdir, extra_path = bzrdir.BzrDir.open_containing(location)
14 except errors.NotBranchError:
15 raise NoColocatedWorkspace(directory=location)
16- self.has_tree = a_bzrdir.has_workingtree()
17+ self.has_tree = (
18+ isinstance(a_bzrdir.transport, LocalTransport) and
19+ a_bzrdir.has_workingtree()
20+ )
21
22 if not self.has_tree:
23 self.base = urlutils.normalize_url(location)

Subscribers

People subscribed via source and target branches