Symlinks to repository branches don't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned | ||
Breezy |
Triaged
|
Low
|
Unassigned |
Bug Description
current reproduction:
% cd ~/bzr/bzr.2.0
% ln -s ../trunk trunk
% bzr st trunk
bzr: ERROR: trunk is not in the same branch as trunk
Most other commands work.
----
If you create a branch inside a shared repository, then create a symlink to the branch from outside the repository, you can't operate on the symlink as if it's a branch. Perhaps this is unsupported, but IMHO it should work.
eg:
concordia ~$ bzr init-repo --trees test-repo
concordia ~$ bzr init test-repo/branch
concordia ~$ ln -s test-repo/branch
concordia ~$ ls -l branch
lrwxrwxrwx 1 michael michael 16 2006-06-05 11:15 branch -> test-repo/branch
concordia ~$ bzr st branch
bzr: ERROR: No repository present: u'/home/
bzr.log:
opening working tree u'/home/
not a branch in: u'/home/michael/' Not a branch: /home/michael/
not a branch in: u'/home/' Not a branch: /home/
not a branch in: '/' Not a branch: /
[ 9574] Mon 11:15:31.888 ERROR: No repository present: u'/home/
Traceback (most recent call last):
File "/home/
return run_bzr(argv)
File "/home/
ret = run(*run_argv)
File "/home/
return self.run(
File "/home/
result = func(*args, **kwargs)
File "/home/
File "/home/
return internal_
File "/home/
tree = WorkingTree.
File "bzrlib/
File "bzrlib/bzrdir.py", line 908, in open_workingtree
File "bzrlib/
File "bzrlib/
File "bzrlib/bzrdir.py", line 894, in open_branch
File "bzrlib/branch.py", line 737, in open
File "bzrlib/bzrdir.py", line 350, in find_repository
NoRepositoryPre
Perhaps we should just be calling os.path.realpath() somewhere on the path we get from the user?
Changed in bzr: | |
status: | Confirmed → In Progress |
assignee: | John A Meinel (jameinel) → Martin Pool (mbp) |
description: | updated |
tags: | added: symlinks |
Changed in bzr: | |
assignee: | Martin Pool (mbp) → nobody |
status: | In Progress → Confirmed |
tags: | added: check-for-breezy |
tags: | removed: check-for-breezy |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Low |
Michael Ellerman wrote:
> Public bug reported:
>
> If you create a branch inside a shared repository, then create a symlink
> to the branch from outside the repository, you can't operate on the
> symlink as if it's a branch. Perhaps this is unsupported, but IMHO it
> should work.
>
There is an alternate use case, which is why we currently do not support
this.
Here is the example: You have a normal standalone branch in 'branch',
and inside of it you have a symlink 'symlink', which points outside of
the branch. Let's say "branch/symlink => /etc/hosts"
cd branch
bzr status symlink
Which you call because you want to find out whether 'symlink' changed
(now it points to /etc/hosts.allow).
If you dereference the symlink, you will jump into '/etc', and then
tracking back upwards would leave you with no bzr branch.
The difficulty is that you can give a path to a branch, or to a file
inside of a branch. And you may want to dereference a symlink to a
branch, but you don't want to dereference a symlink to a file.
If you can come up with decent heuristics about when something should
work, we probably could support it. But for now, we explicitly try not
to dereference symlinks.
John
=:->