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

The Archive Base Latest Questions

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

All our developers are able to log in to our staging server via ssh.

  • 0

All our developers are able to log in to our staging server via ssh.

When they run any hg command on the staging servers it makes them the owner of the updated/new files. I need these files to be owned by the user/group www-data.

I tried editing the sudoers files to this

Cmnd_Alias WWW_DATA_CMDS = /usr/bin/svn, /usr/bin/hg

%developers  ALL=(www-data) NOPASSWD: WWW_DATA_CMDS

As you can see we have SVN on the server as well (we are moving away from SVN to HG) and this setup works fine for SVN, if we run the SVN command it creates files as www-data

How do I get the same to work for Mercurial?

  • 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-26T03:07:06+00:00Added an answer on May 26, 2026 at 3:07 am

    First understand that there’s no magic here. Mercurial always creates files as the user it runs as, end of story. It doesn’t try (and doesn’t even have permission) to do anything else.

    That means that if you run hg only via sudo, and the permissions of the existing files are right, it WILL do what you want here.

    But that also means that if users run hg without sudo, and they have the right permissions, they WILL make a mess. Mercurial is content to let you do whatever is allowed by the Unix permission model.

    There are three approaches to dealing with this:

    • slap knuckles with a ruler until people use sudo consistently
    • use a wrapper like mercurial-server that funnels all users into one account
    • properly configure group, umask, ownerships, and permissions so things can actually be shared

    This last works as follows:

    • make sure every user X has a matching default group X (most modern systems already do this)
    • add everyone (and wwwdata) to a secondary group project-foo
    • make sure everyone’s umask is set at login to NOT mask group read/write (umask 007, not 077)
    • set all files in the project to be in group project foo (chgrp -R project-foo foo/)
    • make all files read/write by that group (chmod -R g+rw foo/)
    • make all directories traversable and setgid (find foo/ -type d | xargs chmod g+sx)

    This will ensure that every time a user creates a file in the project, it will be read/write for everyone else in the group.

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

Sidebar

Related Questions

Like all developers with OCD I try to organise my namespaces within our project
All front-end developers know the pain of coding for Firefox, then viewing our then
For some reason our developers can only add projects that they've created to Team
At our company all the developers have local admin rights. But now one of
After working the whole day with Google Code our group of developers was able
We have all of our unit tests written so that they create and populate
Currently all our files are stored on a Windows network drive and with 15
Currently all our GUI components are written in MFC. Our build environment is: VC
we're currently generating all our official documents using XSL-FO transformation using .xml files as
when we write all our application methods and variables in a classes is nothing

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.