tags 695143 + upstream wontfix 
thanks

On Tue, Dec 04, 2012 at 04:44:41PM +0100, g1 wrote:
> Package: mercurial
> Version: 1.6.4-1
> Severity: normal
> 
> If I "hg remove" the last file in a directory, mercurial removes
> the directory on commit (see below). 
> 
> Perhaps it's an upstream bug.
> 
> Perhaps it's a feature documented in the Definitive Guide, but I
> won't buy the book just to check this, and the online version at
> http://hgbook.red-bean.com/read/ is barely usable.

Mercurial tracks files.  It has no way of representing an empty
directory so it deletes it when you remove all the files in it.  If
you want to have an empty directory in your repository, add an empty
.dummy file in it.  For more info see "Mercurial tracks files, not
directories" in the Definitive Guide:

http://hgbook.red-bean.com/read/mercurial-in-daily-use.html

Cheers,
Javi
 
> Script started on Tue Dec  4 16:21:35 2012
> | $ hg init
> | $ mkdir d
> | $ echo a > d/a
> | $ hg add d/a
> | $ hg commit -m file_created 
> | $ ls -s d
> | total 4
> | 4 a
> | $ hg manifest -v
> | 644   d/a
> | $ hg rm d/a
> | $ hg commit -m file_removed
> | $ ls -s d
> | ls: cannot access d: No such file or directory
> Script done on Tue Dec  4 16:23:16 2012

Attachment: signature.asc
Description: Digital signature

Reply via email to