Ownership question

yosmc stefan at creativitypool.com
Sun Feb 22 12:08:34 CST 2009


Hi Martin,

Thanks for the very detailed reply. Maybe my problem is that I am doing all
of this on the SAME machine? When you ssh to a different server then you get
to specify the credentials for access, and voila! you have fixed the
ownership at the same time. When it's all happening on the same machine
though, you need to run "hg clone" as a user that has access to both the old
and the new directory (in my case: root) and there's no flag to set a
specific owner for the new location.

This would also explain why I found nobody with the same issue, as cloning
it all within the same machine is probably a bit unusual. So right now I'm
assuming I will have to use chown after all - that is, unless someone on
this mailing list tells me differently. ;)


Martin Geisler wrote:
> 
> yosmc <stefan at creativitypool.com> writes:
> 
>> I'm new to Mercurial and I'm having trouble with file ownership after
>> running "hg clone". I've also searched the Net throughly but since I
>> could find this topic addressed anywhere, I have reason to believe
>> that I must be doing something substantially wrong. ;)
> 
> Mercurial simply doesn't track ownership of files.
> 
> It wouldn't work in any sane way: when I as user "mg" commit a file to
> my local clone, push it to bitbucket.org, and then checkout the file on
> another computer as user "mgeisler", then I cannot create a file owned
> by "mg". (Normal users cannot change ownership of files in Linux)
> 
> In your case it seems that you want to deploy your website with
> Mercurial -- no problem, I do this myself on http://viff.dk/. It works
> like this:
> 
> * I (as user "mg") edit the files in my local clone of the website
> 
> * I push it with SSH to ssh://viff@viff.dk/repos/viff.dk. This means
>   that the user "viff" on the webserver stores the new changesets in the
>   repository at ~viff/repos/viff.dk.
> 
> * I have a hook in ~viff/repos/viff.dk/.hg/hgrc which updates the
>   repository (otherwise the files wont change, we would only be adding
>   new history) and rebuilds the HTML files:
> 
>   [hooks]
>   changegroup.build = hg update && ./buildhtml.py
> 
> * The ~viff/repos/viff.dk repository is served with Apache.
> 
> So the files are owned by me on my computer and on the webserver they
> are owned by the correct user -- no permission problems at all.
> 
> The important point is that you don't want your developers to be messing
> around with the files on the server, instead they should edit them in
> their local clones. When they are happy with a fix, they will push to
> the server and at that point the ownership will change as needed.
> 
> This also means that you probably don't want the files lying around
> owned by "root" on the server, instead use an unpriviledged user, the
> webserver typically only needs to read the files.
> 
> -- 
> Martin Geisler
> 
> VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
> SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
> 
>  
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
> 
> 

-- 
View this message in context: http://www.nabble.com/Ownership-question-tp22146498p22149652.html
Sent from the Mercurial mailing list archive at Nabble.com.



More information about the Mercurial mailing list