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 6319925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:53:04+00:00 2026-05-24T15:53:04+00:00

I have a mercurial repository with the following directory structure: / /system /applications /applications/client1

  • 0

I have a mercurial repository with the following directory structure:

/
/system
/applications
/applications/client1
/applications/client2
/applications/client3

I am serving the repo over an apache subdomain over http (no ssl yet) and want to restrict access for push, pull and commit of course. Generally i dont want some users to see the directories at all and also not the history of the directories!

  1. Is there a chance to restrict access to a directory in a mercurial repository.
  2. How can i give access to the client 1 folder only for client1, client2 only for client2 on a linux based system? Note: I dont want to split the repository into sub repositories if not necessary!
  3. If this is not working without sub repositories, can someone please tell me how to do this with sub repositories in this case with my directory structure.

I am lost 🙁

  • 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-24T15:53:05+00:00Added an answer on May 24, 2026 at 3:53 pm

    Since you have everything in 1 repository, then no.

    tl;dr: A repository is always complete, and if you can clone it, you can see everything, there is no way to restrict access to content in a local clone, only to a central server-hosted clone.


    A Mercurial server can deal with authorization in two ways:

    1. It can restrict access to the repository
    2. It can use hooks to prevent pushes with content that that user is not allowed to modify

    The first type would make the whole repository read-only, or unavailable. However, if a user has read-access, he will be able to clone, and see, the whole repository, history and files alike.

    But, you could prevent that same user from modifying the central copy by prohibiting pushes to it. This would mean that that user could do whatever he wanted to with his own private clone, but he would not be able to push those changes back to the central clone.

    The other type would allow you to control where changes was allowed to happen a bit more fine-grained. However, note that again, a user will be able to clone, and see, the whole repository.

    Additionally, the user will also be able to do whatever he wants to with his own personal clone. However, whereas pushes to the central repository is not totally prohibited with this type of authorization, a hook would look at the changesets being pushed, and if, say, you decide that that user is not allowed to push changes to “client2” content, any such changesets that he tries to push will be aborted.

    In other words, the user is able to modify his private clone, including change things in “client2”, but if he commits a changeset with “client2” changes, he will not be able to push back to the central repository. He would then have to strip away, or otherwise get rid of those changesets, before his pushes would go through.

    So to summarize:

    1. You can prohibit the user from cloning altogether, this would make the whole repository unavailable to him
    2. You can prohibit pushes, but allow cloning
    3. You could use hooks to analyze incoming changesets, and prevent changes to content that user is not allowed to modify
    4. Regardless, if the user is able to make a clone, that clone is always complete, and unrestricted, on the users computer. You cannot restrict access in that clone, all you can do is point 1, prohibit the user from cloning to begin with.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following is the scenario: I have a remote Mercurial repository at ssh://remotehost//dir/repo and I
I have a mercurial repository which uses Mercurial queues. Assume the following scenario. I
I have a mercurial repository that is not accessible by Http. I can't figure
I have a mercurial repository myProject : myProject |- file1.js |- file2.css |- useful.js
I have a Mercurial repository set up on a Linux server, and some (but
I have a Mercurial repository that I can see just fine if I navigate
I have an existing Mercurial repository for a C++ application in a small corporate
I have a NetBeans project and the Mercurial repository is in the project root.
I have a project that I want to push to a Mercurial repository on
I have pulled an incoming changes from a codeplex-based mercurial repository and have arrived

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.