Mercurial push, abort: authorization failed

后端 未结 8 1756
悲哀的现实
悲哀的现实 2021-01-31 14:14

I\'m having problems with pushing to mercurial repository:

$ hg push
pushing to https://user:***@hg.domain.com/X_repo
searching for changes
abort: authorization          


        
相关标签:
8条回答
  • 2021-01-31 14:55

    Just in case it might help someone - I encountered this error for unknown reasons, all permissions were OK, and just restarting apache solved it.

    0 讨论(0)
  • 2021-01-31 14:57

    Problem turned out to be repo dir permissions. chown www-data solved it...

    0 讨论(0)
  • 2021-01-31 15:02

    My problem was a bit different. Password change triggered it... And I had a repo/.hgrc and a repo/.hg/hgrc. Not sure why, but these were conflicting.

    For the record, the cleanest way I've found is to keep a global configuration file (on Windows C:\Users\<user>\mercurial.ini or Linux /home/<user>/.hgrc) with all the configuration that applies to all repositories (profiles, plugins/extensions, repos, etc), and then per repo, just use something like:

    [paths]  
    default = https://path/to/remote/repo
    
    # any other repo-specific config
    

    Why I had another repo-specific mercurial config file, I don't know -- now everything is cleaned up and working nicely.

    0 讨论(0)
  • 2021-01-31 15:04

    If anybody wants to make it run on local machine then adding this to server REPO/.hg/hgrc will do the work:

    [web]
    allow_push = *
    push_ssl = false
    

    as described at this site.

    0 讨论(0)
  • 2021-01-31 15:10

    For those with TortoiseHg pushing to a web server (another unauthorized user on another PC):

    In TortoiseHg: File - Settings - (Either globally or just for the current repository - tabs) then the Server settings. Web Server

    Push Requires SSL - No
    Allow Push - *
    

    This does the same thing through the UI as lukmdo's answer above (editing the hgrc file).

    0 讨论(0)
  • 2021-01-31 15:13

    It is strange that you can run hg outgoing but not hg push since it is my understanding that they both authenticate in the same way.

    Unfortunately I'm not a hgweb expert. Please mail to the Mercurial list (mercurial@mercurial-scm.org) and/or come online in IRC (#mercurial on irc.freenode.net). There will be many more people to help you there. IRC is especially good since these things are much easier to debug interactively.

    0 讨论(0)
提交回复
热议问题