How to use "mq" to "hg forget" a file?

Harvey Chapman hchapman at 3gfp.com
Mon Oct 5 13:28:21 UTC 2015


> On Oct 5, 2015, at 8:56 AM, Dr Rainer Woitok <rainer.woitok at gmail.com> wrote:
> 
> 
> Greetings,
> 
> how can I create a patch using "mq" which does NOT REMOVE a file but on-
> ly "hg forget" it?
> 
> The reason I'm asking is that a remote repository I cloned has a version
> controlled file "configure"  which in fact is created via "autoconf" and
> thus shouldn't be version controlled.  But:

I’m assuming that you’re only trying to remove configure from source control going forward.

# Create an “existing” repo
$ hg init
$ touch configure A B C
$ hg commit -Am "existing repo"
adding A
adding B
adding C
adding configure

# Ignore and remove “configure” from Mercurial 
$ echo configure >> .hgignore
$ hg add .hgignore
# Tell Mercurial to remove configure from source control,
# leave the working copy alone.
$ hg remove --after --force configure
$ hg commit -m "removing and ignoring configure"
$ ls -a
.         ..        .hg       .hgignore A         B         C         configure
$ hg status --all
I configure
C .hgignore
C A
C B
C C




More information about the Mercurial mailing list