In my project, I am using Mercurial and a folder in when the user can upload file. But since the user will upload files, the folder is empty.

I don't know how I can add this folder to my project without putting any file inside.

Do you know how I can do ?

link|improve this question

feedback

2 Answers

up vote 12 down vote accepted

One of the solution is to add a .emtpy file in your repository :

$ touch uploads/.empty
$ hg add uploads/.empty
link|improve this answer
Yes, that is indeed the correct solution: Mercurial is only keeping track of files, not directories. Another solution is to create the empty directories when you deploy your software. – Martin Geisler Dec 21 '09 at 23:23
feedback

I have created a python script that automates the process of creating/deleting those files. The script has been released here.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.