Fossil SCM
Committing one file while another is pending delete will commit both files.
5cc33a6aa0621be…
· opened 15 years, 4 months ago
- Type
- Code_Defect
- Priority
- —
- Severity
- Important
- Resolution
- Fixed
- Subsystem
- —
- Created
- Nov. 24, 2010 2:03 p.m.
It seems that I have found a bug in fossil. I found this as I was trying to add a file but a diff of my commit shows that I removed one as well. However when I committed, I only specified the file that I wanted to add:
fossil commit path/to/file_to_add -m "Added file."
I performed the following operations to test and reproduce the bug:
# mkdir /tmp/fossilbug # cd /tmp/fossilbug # fossil new my.fossil project-id: 2b1773e0efaf0a28844f51226f4dcf88ff7ed73b server-id: 1b7807e55a0d9c863b0e47063d59ef700d7f03cc admin-user: admin (initial password is "15b831") # fossil open my.fossil # date > file1 # date > file2 # date > file3 # date > file4 # fossil add file* ADDED file1 ADDED file2 ADDED file3 ADDED file4 # fossil commit -m "Added 4 test files" New_Version: 181cd0b02dfd84476e804eb9230e87c7ff26bdcb # fossil delete file1 DELETED file1 # date > file4 # fossil changes DELETED file1 EDITED file4 # fossil commit file4 -m "committing ONLY the modified while a file is pending deleted" New_Version: 98de35d30e35a6a206c943b7b34afbe4744db2cf # fossil changes DELETED file1
As you can see, I created a new fossil repo for my test. Added 4 files with random content and committed.
Then I removed one file and I modified another. I commit the file that I modified but not the file that I removed. In my local folder, the deleted file is still pending. However... if you use finfo or diff.. you will see that the file WAS deleted on my commit.
# fossil finfo file1
History of file1
2010-11-23 [98de35d30e] DELETED test modified while a file is pending deleted
(user: roychri)
2010-11-23 [181cd0b02d] test 1 (user: roychri, artifact: [99d7a1f973])
# fossil diff --from 181cd0b02dfd84476e804eb9230e87c7ff26bdcb --to 98de35d30e35a6a206c943b7b34afbe4744db2cf
DELETED file1
CHANGED file4
Index: file4
===================================================================
--- file4
+++ file4
@@ -1,1 +1,1 @@
-Tue 23 Nov 2010 10:14:01 EST
+Tue 23 Nov 2010 10:14:32 EST
Then when I commit the deleted file, it creates an empty commit (diff empty and not files in list).
CONCLUSION:
I cannot perform a partial commit (where I specify each file on the command line) when I have pending deleted files that I am NOT ready to commit.
anonymous added on 2010-11-24 14:06:58: It seemed that fossil is not formatting my entry the way I expected. Sorry about that.
You can view source to see it well. The admins of this site can put a "pre" HTML tag around my text so the formatting is better.
I cannot seem to be able to edit my previous entry.
anonymous added on 2010-11-25 01:30:16: I see that the resolution is fixed but... no comment. Which version of fossil has this fix? It would be nice to have this information so I can test it... :)
Thanks