[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn trunk r17244: FAIL (x86_64-unknown-linux-gnu static ra_svn fsfs)

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2005-11-09 04:22:50 CET

On Wed, 2005-11-09 at 01:27, Malcolm Rowe wrote:
> On Wed, Nov 09, 2005 at 01:13:03AM +0530, Madan U Sreenivasan wrote:
> > Warning:'post-commit' hook failed with error
> > output:
> > /svntest/obj-st/subversion/tests/clients/cmdline/svn-test-work/repositories/commit_tests-34/hooks/post-commit:
> > line 2: /dev/stderr: Permission denied
>
> So the post-commit hook can't write to /dev/stderr. That's strange, but
> by no means impossible. I don't know if something like 'echo foo 1>&2' is
> more portable than assuming you can write to /dev/stderr - anyone?
>
> It'll still completely fail on Windows, of course:
Pl. find below a patch that makes this action portable to both windows
and unix. What however requires more comments is how to extract the path
of the python executable itself in the line...
+ hook_script_code = ( "#!/usr/bin/env python\n"
    How do I find the path to the python executable? Any ideas?
    Pl. feel free to comment on the below patch...

------------------------8<----------------8<-------------------
Index: commit_tests.py
===================================================================
--- commit_tests.py (revision 17264)
+++ commit_tests.py (working copy)
@@ -1970,11 +1970,16 @@

   # Setup the hook configs to echo data back
   post_commit_hook = svntest.main.get_post_commit_hook_path (repo_dir)
+ if sys.platform == 'win32':
+ post_commit_hook = os.path.join (post_commit_hook, ".bat")
+
+ hook_script_code = ( "#!/usr/bin/env python\n"
+ "import sys\n"
+ "\n"
+ "sys.stderr.write('Nothing doing')\n"
+ "sys.exit(-1)\n")
   svntest.main.file_append (post_commit_hook,
- """#!/bin/sh
- echo "Post-commit Hook says nothing doing
on stderr" > /dev/stderr
- exit -1
- """)
+ hook_script_code)
   os.chmod (post_commit_hook, 0755)

   # Modify iota just so there is something to commit.
@@ -1989,8 +1994,8 @@
                       "Committed revision 2.\n",
                       "\n",
                       "Warning:'post-commit' hook failed with error
output:\n",
- "Post-commit Hook says nothing doing on
stderr\n",
- "\n"]
+ "Nothing doing\n"
+ ]

   svntest.actions.run_and_verify_svn (None, expected_output, [],
                                       'ci', '-m', 'log msg', iota_path)
-----------------------8<-------------8<------------------

Regards,
Madan.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 9 04:14:54 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.