Adding a symlink to another branch fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
In Progress
|
Medium
|
Unassigned |
Bug Description
Older 'bzr' would create a failure if you tried to "bzr add b1/link-
However, a symlink may be added to a branch then changed to point to another branch and the change can be commited without a problem.
The reduced case below may be easier to follow.
Reduced case:
/root # bzr init b1
/root # bzr init b2
/root # touch b2/foo
/root # ln -s ../b2 b1/linkto_b2
/root # bzr add b1/linkto_b2
adding foo
/root # bzr status b1
unknown:
linkto_b2@
/root # bzr status b2
added:
foo
/root # rm -r b1 b2
/root # bzr init b1
/root # bzr init b2
/root # ln -s dummy b1/linkto_b2
/root # bzr add b1/linkto_b2
added linkto_b2
/root # rm b1/linkto_b2
/root # ln -s ../b2 b1/linkto_b2
/root # bzr ci -m 'success' b1
Committed revision 1.
Related branches
- bzr-core: Pending requested
-
Diff: 209 lines (+101/-21)4 files modifiedNEWS (+7/-0)
bzrlib/bzrdir.py (+39/-16)
bzrlib/tests/blackbox/test_add.py (+26/-4)
bzrlib/tests/test_bzrdir.py (+29/-1)
- John A Meinel: Approve
-
Diff: 73 lines (+24/-2)4 files modifiedNEWS (+4/-0)
bzrlib/tests/per_transport.py (+14/-1)
bzrlib/transport/local.py (+4/-1)
bzrlib/transport/sftp.py (+2/-0)
Changed in bzr: | |
status: | Unconfirmed → Confirmed |
Changed in bzr: | |
assignee: | abentley → nobody |
Changed in bzr: | |
milestone: | 0.13 → none |
Changed in bzr: | |
assignee: | nobody → Martin Pool (mbp) |
status: | Confirmed → In Progress |
description: | updated |
tags: | added: add symlink |
Changed in bzr: | |
assignee: | Martin Pool (mbp) → nobody |
A related problem is renaming a symlink, which points to another branch, fails. Basically, where symlinks point to should be considered the contents of a symlink, and bzr should never resolve them for any other purpose. Hence, bzr should always test to see if a file is a symlink before doing anything else with it (some python equivalent to lstat, sorry I'm not a python programmer).
Following the end of the reduced case above (from bug #32669): linkto_ b2
/root # bzr rename b1/linkto_b2 b1/renamed_
bzr: ERROR: b1/linkto_b2 is not in the same branch as b1/linkto_b2