hgignore syntax

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

hgignore syntax

Michael P. Soulier
I've placed an .hgignore file beside the .hg directory in my repository.

I have an 'opag' subdir where I want to ignore two files.

[msoulier@kanga opagdjango]$ cat .hgignore
opag/urls.py
opag/settings.py

[msoulier@kanga opagdjango]$ hg status
M opag/settings.py
M opag/urls.py

It doesn't seem to be ignoring them.

Is my syntax wrong?

Thanks,
Mike
--
Michael P. Soulier <[hidden email]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: hgignore syntax

Michael P. Soulier
On 12/07/07 Michael P. Soulier said:

> I've placed an .hgignore file beside the .hg directory in my repository.
>
> I have an 'opag' subdir where I want to ignore two files.

Ah, solved on IRC. ignore only ignores files not in source control.

Mike
--
Michael P. Soulier <[hidden email]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: hgignore syntax

Evan Powers-2
In reply to this post by Michael P. Soulier
On 7/12/07, Michael P. Soulier <[hidden email]> wrote:
> Is my syntax wrong?

Yes. Read the documentation and look at the examples.

http://www.selenic.com/mercurial/hgignore.5.html

- Evan
_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: hgignore syntax

Michael P. Soulier
On 12/07/07 Evan Powers said:

> On 7/12/07, Michael P. Soulier <[hidden email]> wrote:
> >Is my syntax wrong?
>
> Yes. Read the documentation and look at the examples.
>
> http://www.selenic.com/mercurial/hgignore.5.html

I did both of those, hence my question.

According to others, you are incorrect, the syntax is fine, the issue is that
hgignore doesn't ignore files under source control.

Mike
--
Michael P. Soulier <[hidden email]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: hgignore syntax

Evan Powers-2
On 7/12/07, Michael P. Soulier <[hidden email]> wrote:
> According to others, you are incorrect, the syntax is fine, the issue is that
> hgignore doesn't ignore files under source control.

Serves me right for my quick reply. There's still some nuances in the
docs that I suspect you've missed, however; as written, your .hgignore
will ignore way more than I suspect you want it to. I'll demonstrate:

$ mkdir testrepo; cd testrepo; hg init
$ mkdir c
$ touch a.txt a_txt ba.txt c/a.txt
$ hg status
? a.txt
? a_txt
? ba.txt
? c/a.txt
$ echo a.txt > .hgignore
$ hg status
? .hgignore

Changing to glob syntax (regexp is the default) helps, sorta:

$ echo -e "syntax: glob\na.txt" > .hgignore
$ hg status
? .hgignore
? a_txt
? ba.txt

But to ignore ONLY a.txt, you have to use:

$ echo -e "^a\.txt" > .hgignore
$ hg status
? .hgignore
? a_txt
? ba.txt
? c\a.txt

So, I suspect you really want your .hgignore file to contain:

syntax: regexp
^opag/urls\.py
^opag/settings\.py

Hope that was helpful,
- Evan
_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: hgignore syntax

Michael P. Soulier
On 12/07/07 Evan Powers said:

> Hope that was helpful,

Very helpful, thanks.

Mike

_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: hgignore syntax

David Frey-2
In reply to this post by Michael P. Soulier
On 7/12/2007, "Michael P. Soulier" <[hidden email]> wrote:

> On 12/07/07 Evan Powers said:
>
> > On 7/12/07, Michael P. Soulier <[hidden email]> wrote:
> > >Is my syntax wrong?
> >
> > Yes. Read the documentation and look at the examples.
> >
> > http://www.selenic.com/mercurial/hgignore.5.html
>
> I did both of those, hence my question.

You must have missed this part:

"Mercurial ignores every unmanaged file that matches any pattern in an
ignore file. The patterns in an ignore file do not apply to files
managed by Mercurial. To control Mercurial's handling of files that it
manages, see the hg(1) man page. Look for the "-I" and "-X"
options."

_______________________________________________
Mercurial mailing list
[hidden email]
http://selenic.com/mailman/listinfo/mercurial