1. Jason Harris
  2. MacHg
  3. Issues
Issue #304 resolved

P4D4::Passwords ending in '!' cause problems on push

Anonymous created an issue

I have looked at many different configuration aspects of MacHg and am able to clone a repository from a server onto my local machine but cannot push any changes back up to the server without getting the error message:

Error During Push Mercurial reported error number 255: abort: authorization failed

The push and pull operations are both done over https but I have set up fingerprints, username and password to no avail. Push works from a Windows machine using TortoiseHG and from Mercurial on the command line on the Mac without problems. The MacHg log has nothing particularly useful to say so I am out of ideas. Any suggestions?

Comments (13)

  1. Jason Harris repo owner

    Look at http://machghelp.jasonfharris.com/kb/general/machg-and-using-mercurial-from-the-command-line

    Then open a terminal from MacHg and try a push using first mhg and then chg. These are the commands that MacHg uses internally to do the pushing and pulling.

    Have you set in the MacHg advanced preferences the option "use ~/.hgrc" since this will use the settings in there if there are any fingerprints, etc which are causing an issue.

    Please get back to me if this solved, or didn't solve your problem...

    Cheers, Jason

  2. Anonymous

    I don't get any error messages when I use mhg and chg (what is the difference between these two actually?). And furthermore the push works in both cases.

    Regarding the option "use /.hgrc" I do have that checked yes.


  3. Anonymous

    Hi Jason - any word on this issue? This is a show stopper for me to be able to use MacHg at the moment. Thanks, Julian

  4. Anonymous

    I found the issue. I am using https and the password was being escaped TWICE before sending in the URL over the wire. Most of the time the password is only escaped once and doesn't cause a problem but for a push operation it was getting subjected to a second dose - which mangled it. So this error would only occur for people who used https and used a password with unusual characters (which actually ought to mean quite a few people!).

    I corrected the problem by unescaping it in FullServerURL of AppController.m thus:

    if (hasPassword && visibility == eAllPasswordsAreMangled) password = @"*"; else if (newKeychainItem && visibility == eKeyChainPasswordsAreMangled) password = @"*"; else if (newKeychainItem) password = nonNil(newKeychainItem.password); else password = UNESCAPE_STRING([baseURL password]);

    NSLog(@"Password is %@", password);

    For some reason I had a to include a local copy of the macro UNESCAPE_STRING as the builder couldn't see the one in "NSURL+Parameters.m". Maybe those macros should be moved to the header file?


  5. David McClelland

    Trying out MacHG for a couple of days and see the same prob. Is there a solution built in to a newer release? I will change clients before I change to clear text passwords. Never mind I found the client that Atlassian gives away - not perfect either, but will do for now.

  6. Jason Harris repo owner

    I am unable to reproduce this. Can someone give me an example of a password you can enter in MacHg which has problems during a push. I tried 'h /n%^!h' but that worked fine without this change suggested above of adding UNESCPAE_STRING(...)

  7. Anonymous

    This is happening for me too, this is over an http connection - using SCMManager as my server repository

    Server is MacOSX Server 10.6.8, Client is MacOSX 10.7.4

    The test in Terminal works fine but I cannot do a push

  8. Dave Pape

    I can confirm Thitipong's comment: I have a password ending in an exclamation mark and that causes MacHg to throw the "authorization failed" error.

  9. Log in to comment