Rename may fail when file and directory have the same name differing by case

Bug #368931 reported by Chris Jones
14
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

Revision history for this message
Chris Jones (tortoise) wrote :

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.

Revision history for this message
Robert Collins (lifeless) wrote :

Could you write a test case? Minimally one that will trap on windows, but ideally one one that will trap on unix too.

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
tags: added: patch
Martin Pool (mbp)
tags: added: case-sensitivity
Revision history for this message
Martin Pool (mbp) wrote :

I'll see about adding a test.

Changed in bzr:
assignee: nobody → Martin Pool (mbp)
status: Confirmed → In Progress
Revision history for this message
Martin Pool (mbp) wrote :

will be fixed in 2.0.5

Revision history for this message
Martin Pool (mbp) wrote :

Now merged to trunk, will be in 2.2b1

Changed in bzr:
milestone: none → 2.2.0b1
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.