[Python-apps-team] Bug#695143: mercurial removes directory when removing the last contained file.

Javi Merino vicho at debian.org
Tue Dec 4 22:51:46 UTC 2012


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20121204/736b86e8/attachment.pgp>


More information about the Python-apps-team mailing list