I am using Ubuntu on my workstation and whenever I try to commit/push to a Mercurial repository located on a CIFS share in my LAN, I get this error thrown: abort: Operation not permitted: /media/repos/myRepo/.hg/journal.dirstate
However, prepending any command that causes this with sudo, will let mercurial continue without throwing any errors at me.
What should I do stop having to sudo every commit?
Your user doesn’t have write permissions for /media/repos/myRepo. You can check the owner and permissions using ls -la. Depending on the result of that you should either:
Try changing the permissions with chmod to allow access by your user or group.
sudo chmod -R ug+w /media/repos/myRepo
(ug+w means add write permissions for the group and the owner user, this will work if you’re in the same group as the owner. Otherwise, you could try just +w which will add it for all users, but this is less secure.)
Try changing the owner with chown to your user or group.
sudo chown -R <myuser>:<mygroup> /media/repos/myRepo
(Both myuser and mygroup are optional)
Also be sure to use chown and chmod recursively on the entire repository. If journal.dirstate is recreated every time (which I think is what happens), it inherits its permissions from the .hg directory, so any permissions you change on the file itself may get lost.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With