View Ticket
Not logged in
Ticket UUID: 4429a81aa893fc188f683ce2e3397cdaca3c99c7
Title: Strange behavior when changing case of filenames on case-insensitive filesystem
Status: Open Type: Code_Defect
Severity: Priority:
Subsystem: Resolution: Open
Last Modified: 2011-01-22 15:09:45
Version Found In: 94c60f3c7e
Description & Comments:
Consider the case when renaming "myfile.txt" to "MyFile.txt" on case-insensitive filesystem (e.g. HFS+), but forgetting to tell Fossil about rename, and just using "fossil addremove" command. "MyFile.txt" will be added as a new file, but "myfile.txt" won't be deleted, so we end up with two identical files with different names when looking at repository via "fossil ui", but when we checkout them, we of course, get just one file.

Here's test:

$ fossil new repo.fossil
project-id: 3eb03c25edc4b03e6b9e64985f25d20363aeda0c
server-id:  f18702b2ee13d9a34b020be3cb096ed65f32e1ec
admin-user: dmitry (initial password is "2affdf")

$ mkdir repo
$ cd repo
$ fossil open ../repo.fossil 
$ echo "First" >> myfile.txt
$ fossil add myfile.txt 
ADDED  myfile.txt

$ fossil commit -m "lowercase"
New_Version: 7a77d8c7c80e239225351d4a9b9e9d02c591ebdf

$ mv myfile.txt MyFile.txt
$ ll
total 24
-rw-r--r--  1 dmitry  staff     6 Jan 22 13:11 MyFile.txt
-rw-r--r--  1 dmitry  staff  7168 Jan 22 13:11 _FOSSIL_

$ fossil changes
$ fossil addremove
ADDED  MyFile.txt
added 1 files, deleted 0 files

$ fossil commit
/usr/bin/vim "/Users/dmitry/ST/repo/ci-comment-A85BD1C98500.txt"
New_Version: 3fb2e205f8dad54fbac31a68177648d115ca7860

$ rm *
$ fossil open ../repo.fossil 
MyFile.txt
project-name: <unnamed>
repository:   /Users/dmitry/ST/repo.fossil
local-root:   /Users/dmitry/ST/repo/
project-code: 3eb03c25edc4b03e6b9e64985f25d20363aeda0c
server-code:  f18702b2ee13d9a34b020be3cb096ed65f32e1ec
checkout:     3fb2e205f8dad54fbac31a68177648d115ca7860 2011-01-22 12:12:36 UTC
parent:       7a77d8c7c80e239225351d4a9b9e9d02c591ebdf 2011-01-22 12:11:33 UTC
tags:         trunk
comment:      Renamed. (user: dmitry)
$ ll
total 24
-rw-r--r--  1 dmitry  staff     6 Jan 22 13:13 MyFile.txt
-rw-r--r--  1 dmitry  staff  7168 Jan 22 13:13 _FOSSIL_

Here's manifest of the second commit:

C Renamed.
D 2011-01-22T12:12:36.278
F MyFile.txt 7322e1fd19fd2986254c38eb418971859ede506d
F myfile.txt 7322e1fd19fd2986254c38eb418971859ede506d
P 7a77d8c7c80e239225351d4a9b9e9d02c591ebdf
R 342c091c43d8964d553678092b8218e7
U dmitry
Z cde393ff1422550babdc8a5951aa06d1

anonymous added on 2011-01-22 14:25:40 UTC:
I've made the same test as you and I reproduce everything. But also, I tried the following, may be those extra info can be usefull:

  • I copy the fossil file to another OS which have case sensitive filesystem
  • I've made a checkout (so I got the 2 files)
  • I've edit both of them with different content and then commit
# cat myfile.txt
First file, edited

# cat MyFile.txt Fist file, with capitals, edited

  • I copy back the fossil file to my osx machine with case insensitive, made a checkout, and then I got the following:
meeks-mbp:repo $ fossil open ../test.fsl 
MyFile.txt
overwrite /Users/meeks/fossil/test/repo/myfile.txt (a=always/y/N)? y
myfile.txt
WARNING: manifest checksum does not agree with disk
project-name: <unnamed>
repository:   /Users/meeks/fossil/test/test.fsl
local-root:   /Users/meeks/fossil/test/repo/
project-code: 7dcace824b7b4318bec9a6f80ba2a00fd43215ff
server-code:  6cd5d13657fb215e96caeff6f551584865e6622e
checkout:     c9e1c25a26f1e06694aa947053464db31e854f6d 2011-01-22 14:09:04 UTC
parent:       74671ab018da4f0f288f20cb6d2f1cb21893f084 2011-01-22 14:06:04 UTC
tags:         trunk
comment:      lil changes (user: meeks)
meeks-mbp:repo $ ls
MyFile.txt  _FOSSIL_

And what's strange, I got the file with capital letters, but the content of the one without:

# ls
MyFile.txt  _FOSSIL_

# cat MyFile.txt First file, edited


anonymous added on 2011-01-22 15:09:45 UTC:
Actually. Answering no to this line:

overwrite /Users/meeks/fossil/test/repo/myfile.txt (a=always/y/N)?

Keep only MyFile.txt with proper content. Answered yes produce MyFile.txt only but with content overwritten with content of myfile.txt...