preoutgoing hook leads to "x does not appear to be an hg repository!"
Matt Mackall
mpm at selenic.com
Tue Dec 4 20:12:07 UTC 2007
[de-top-posted for your reading pleasure]
From: Matt Mackall [mailto:mpm at selenic.com]
> On Tue, Dec 04, 2007 at 10:59:46AM -0500, Ezra.Smith at bentley.com wrote:
> > Is there any special reason why the preoutgoing hook gives a
> client-side
> > error message like: "abort: 'http://hg/test-repo' does not appear to
> be
> > an hg repository!" when it disallows outgoing changesets?
>
> Yes, your server hook is sending output to stdout which is attached to
> your CGI server and making it into the HTTP stream, which the client
> interprets as unexpected garbage. Known bug, redirect to /dev/null for
> now. You should then get a pushed failed message.
>
> > According to the hg book, when a hook fails it should display a
> > client-side error with the name of the hook that failed.
>
> ?? That might work locally and maybe even over ssh, but there's no
> provision for that over HTTP, I'm afraid.
On Tue, Dec 04, 2007 at 02:56:59PM -0500, Ezra.Smith at bentley.com wrote:
> Also, to clarify, the hooks are on a central server that serves over
> HTTP, and I'm pushing/pulling from a client on another box. The goal is
> for the client to have a meaningful error message when the user doesn't
> have the appropriate permissions to push or pull from the repo.
Understood. Unfortunately there's currently no provision to pass
textual error messages back to the user via our HTTP protocol. On SSH,
it works by virtue of moving all the server's normal stdout messages
to a separate stderr stream that we display on the client. HTTP is not
as amenable to having two simultaneous streams from one CGI script,
unfortunately. Maybe we can come up with something that doesn't
confuse old clients, but it'll surely be ugly.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list