Кирилл Тишин wrote: > I'm pushing to remote https repository. My commit is blocked by remote hook. > But status message (above history window) is green. It says "Puth to > https://... aborted, ret 1". > > How can I make it red? I can change both local and remote settings and > hooks.
It looks there's no reliable way to handle remote hook failure as an error. The result code 1 just means "nothing to push." Possibly you can raise ErrorResponse [1] to indicate 403 Forbidden or something, but there could be unwanted side-efffect. [1]: http://selenic.com/repo/hg/file/41fc1e078d68/mercurial/hgweb/common.py#l72 > If I rise an exception then message is red, but it is meanless "HTTP Error: > 500 (Internal Server Error)" without any hook output in log. Yes, it's kind of communication error. > Test hook code: > > def pretxnchangegroup(ui, repo, node, **kwargs): > > ui.write("Error\n") > > ui.warn("2nd\n") > > ui.status("Failed\n") > > #raise Exception("Error\n") > > return True > > > > Local output: > > pushing to https://... > > searching for changes > > remote: adding changesets > > remote: adding manifests > > remote: adding file changes > > remote: added 1 changesets with 0 changes to 0 files > > remote: Error > > remote: 2nd > > remote: Failed > > remote: transaction abort! > > remote: rollback completed > > remote: abort: pretxnchangegroup hook failed > > > > TortoiseHg 2.2.1 with Mercurial 2.0.1 > > Also tested on: TortoiseHg 2.3+2-5c3390659440 with Mercurial-2.1 ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Tortoisehg-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

