0

I have a local HG repo for my client work. I've configured the HG server before on earlier versions of OS X without any issues, but on Yosemite I am stuck. I used MacPorts' mercurial package, configured apache with a self-signed SSL cert, and am mostly good to go... hgweb works fine, and I can pull and do other commands.

However I cannot push:

$ hg push --debug --traceback -v
pushing to https://localhost/hg/website.com
using https://localhost/hg/website.com
sending capabilities command
using auth.default.* for authentication
localhost certificate matched fingerprint ************
using auth.default.* for authentication
http auth: user mike, password ************
using auth.default.* for authentication
localhost certificate matched fingerprint ************
query 1; heads
sending batch command
using auth.default.* for authentication
searching for changes
all remote heads known locally
sending branchmap command
using auth.default.* for authentication
sending branchmap command
using auth.default.* for authentication
preparing listkeys for "bookmarks"
sending listkeys command
using auth.default.* for authentication
1 changesets found
list of changesets:
c05e7b9045cf27f7508dcaaace632ba8a9940c4e
bundling: 1/1 changesets (100.00%)
bundling: 1/1 manifests (100.00%)
bundling: file1.txt 1/2 files (50.00%)
bundling: file2.txt 2/2 files (100.00%)
sending unbundle command
sending 12141 bytes
using auth.default.* for authentication
sending: 11/22 kb (50.00%)
sending: 11/22 kb (50.00%)
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 138, in _runcatch
    return _dispatch(req)

...

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 172, in _call
    fp = self._callstream(cmd, **args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 122, in _callstream
    raise util.Abort(_('authorization failed'))
Abort: authorization failed
abort: authorization failed

The username and password are correct... they work on the hgweb interface, and they even worked in the output above during earlier steps (line 8). I've also checked the permissions of the repository a bunch of times... the _www user has full access:

$ ls -al /var/repos/website.com
total 0
drwxrwxr-x   3 _www  staff  102 Oct 19 23:34 .
drwxrwxr-x  11 _www  staff  374 Oct 27 02:09 ..
drwxrwxr-x  10 _www  staff  340 Oct 19 23:34 .hg

HG version: 3.1.2, OSX Version: 10.10, Apache version: 2.4.9

Any help or suggestions would be much appreciated -- thanks in advance!

1

I found the answer. Not sure why this fixes it, but all I had to do was create an hgrc file in the .hg directory of the repository in question (not the local cloned dir), and add:

[web]
allow_push = *

In case anyone finds this answer while trying to debug a different part of the setup, here is a tutorial for the whole setup of Mercurial on Yosemite.

http://www.curvingspace.com/2014/11/05/mercurial-on-yosemite/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.