removing files from the repository without deleting those files

Steve Borho steve at borho.org
Thu Aug 30 09:51:22 CDT 2007


On Wed, 2007-08-29 at 14:53 +0200, Bernd Schubert wrote:
> Hi,
> 
> I have suggested here to use mercurial to monitor /etc and /var on our
> customer systems.
> 
> In principal this works fine, but some file we want to exclude, of course,
> e.g. /etc/mtab.
> 
> Now lets assume I forgot to blacklist /etc/mtab and want to exclude it now.
> So I added it to .hgignore, but of course it still monitored. So how can I
> make mercurial to remove it from its 'monitored archive' (sorry don't know
> how to express myself here properly)?
> 'hg remove' will entirely remove this file, but this is definitely not what
> I want. I already tried 'hg remove --after', but it complains the file has
> changed. So I tried 'hg remove --after --force', ouch, this deleted the
> file.
> My present only workaround is to 
> 
> mv /etc/mtab /etc/mtab.bak
> hg remove --after /etc/mtab 
> mv /etc/mtab.bak /etc/mtab 

It looks like http://www.selenic.com/mercurial/bts/issue541 needs to be
reopened.  I don't understand why 'hg rm --after --force' should delete
the file.  If the user wanted to delete the file they wouldn't use
'--after' in the first place.

-- 
Steve Borho (steve at borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C




More information about the Mercurial mailing list