Rename may fail when file and directory have the same name differing by case
Bug #368931 reported by
Chris Jones
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Martin Pool | ||
2.0 |
Fix Released
|
Medium
|
Martin Pool | ||
2.1 |
Fix Released
|
Medium
|
Martin Pool |
Bug Description
Steps to reproduce:
mkdir test
touch Test test/file
bzr init
bzr add *
bzr mv test/file test/moved_file
Error:
bzr: ERROR: Could not move file => moved_file: Not a directory
from log:
0.138 attempting to move test/file => Test/moved_file
Related branches
lp:~mbp/bzr/368931-rename-case-2.0
Merged
into
lp:bzr/2.0
- John A Meinel: Needs Fixing
- bzr-core: Pending requested
-
Diff: 147 lines (+67/-6)4 files modifiedNEWS (+3/-0)
bzrlib/tests/__init__.py (+18/-1)
bzrlib/tests/per_tree/test_inv.py (+25/-2)
bzrlib/tree.py (+21/-3)
tags: | added: case-sensitivity |
To post a comment you must log in.
When renaming a file and the second file argument doesn't exist bzr:
* Tests whether the file exists with the exact name and path.
* If the exact file does not exist it tries to find it case-insensitively.
* If this fails it takes as much of the path as it has found case-insensitively and appends the unmatched path.
The second step gives up on each element of the path when it finds a case insensitive match. In the example it finds Test before test, gives up and appends moved_file.
The attached patch looks for an exact match on each element before falling back on a case-insensitive match.