Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 696167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:02:07+00:00 2026-05-14T03:02:07+00:00

I have a NetBeans project and the Mercurial repository is in the project root.

  • 0

I have a NetBeans project and the Mercurial repository is in the project root. I would like it to ignore everything except the contents of the “src” and “test” folders, and .hgignore itself.

I’m not familiar with regular expressions and can’t come up with one that will do that.

The ones I tried:

(?!src/.*)

(?!test/.*)

(?!^.hgignore)

(?!src/.|test/.|.hgignore)

These seem to ignore everything, I can’t figure out why.

Any advice would be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:02:08+00:00Added an answer on May 14, 2026 at 3:02 am

    This seems to work:

    syntax: regexp
    
    ^(?!src|test|\.hgignore)
    

    This is basically your last attempt, but:

    • It’s rooted at the beginning of the string with ^, and
    • It doesn’t require a trailing slash for the directory names.

    The second point is important since, as the manual says:

    For example, say we have an untracked file, file.c, at a/b/file.c inside our repository. Mercurial will ignore file.c if any pattern in .hgignore matches a/b/file.c, a/b or a.

    So your pattern must not match src.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a normal Netbeans project, and I would like to add the source
I have a NetBeans java project. This project ( src folder) is composed of
I have an exam and I would like to print my Java (in NetBeans
I have decided to use Netbeans and Mercurial for my latest project (after no
I have a java project in NetBeans and im using Mercurial for version controlling.
I have a NetBeans project set up with a bunch of source classes and
I have a NetBeans javascript project with several included paths for plugins. I do
I have one java project in netBeans. There are some packages, and classes in
So I have imported a project to netbeans. I am using jsf and xhtml
I have this problem getting my newly created php project on Netbeans work on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.