2010-07-20 15:49:10 |
Martin Pool |
description |
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/michael/branch/'
bzr.log:
opening working tree u'/home/michael/branch/'
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/michael/branch/'
Traceback (most recent call last):
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 650, in run_bzr_catch_errors
return run_bzr(argv)
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 612, in run_bzr
ret = run(*run_argv)
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 246, in run_argv_aliases
return self.run(**all_cmd_args)
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 622, in ignore_pipe
result = func(*args, **kwargs)
File "/home/michael/src/bzr/branches/mpe/bzrlib/builtins.py", line 156, in run tree, file_list = tree_files(file_list)
File "/home/michael/src/bzr/branches/mpe/bzrlib/builtins.py", line 49, in tree_files
return internal_tree_files(file_list, default_branch)
File "/home/michael/src/bzr/branches/mpe/bzrlib/builtins.py", line 73, in internal_tree_files
tree = WorkingTree.open_containing(file_list[0])[0]
File "bzrlib/workingtree.py", line 356, in open_containing
File "bzrlib/bzrdir.py", line 908, in open_workingtree
File "bzrlib/workingtree.py", line 1736, in open
File "bzrlib/workingtree.py", line 261, in __init__
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
NoRepositoryPresent: No repository present: u'/home/michael/branch/'
Perhaps we should just be calling os.path.realpath() somewhere on the path we get from the user?
|
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/michael/branch/'
bzr.log:
opening working tree u'/home/michael/branch/'
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/michael/branch/'
Traceback (most recent call last):
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 650, in run_bzr_catch_errors
return run_bzr(argv)
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 612, in run_bzr
ret = run(*run_argv)
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 246, in run_argv_aliases
return self.run(**all_cmd_args)
File "/home/michael/src/bzr/branches/mpe/bzrlib/commands.py", line 622, in ignore_pipe
result = func(*args, **kwargs)
File "/home/michael/src/bzr/branches/mpe/bzrlib/builtins.py", line 156, in run tree, file_list = tree_files(file_list)
File "/home/michael/src/bzr/branches/mpe/bzrlib/builtins.py", line 49, in tree_files
return internal_tree_files(file_list, default_branch)
File "/home/michael/src/bzr/branches/mpe/bzrlib/builtins.py", line 73, in internal_tree_files
tree = WorkingTree.open_containing(file_list[0])[0]
File "bzrlib/workingtree.py", line 356, in open_containing
File "bzrlib/bzrdir.py", line 908, in open_workingtree
File "bzrlib/workingtree.py", line 1736, in open
File "bzrlib/workingtree.py", line 261, in __init__
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
NoRepositoryPresent: No repository present: u'/home/michael/branch/'
Perhaps we should just be calling os.path.realpath() somewhere on the path we get from the user?
|
|