You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2003/06/25 11:53:37 UTC
Python question [was: Re: svn commit: rev 6338 - in
trunk/subversion: libsvn_client tests/clients/cmdline]
cmpilato@tigris.org writes:
> * subversion/tests/clients/cmdline/basic_tests.py
> (basic_mkdir_url): Add -m to the mkdir command so editors don't pop
> up in people's faces when they run the test. :-)
I've done this a couple of times now :( To prevent it happening again
I want the test suite to override my SVN_EDITOR environment variable.
What's the best way to do this? How about the following
Index: subversion/tests/clients/cmdline/svntest/main.py
===================================================================
--- subversion/tests/clients/cmdline/svntest/main.py (revision 6342)
+++ subversion/tests/clients/cmdline/svntest/main.py (working copy)
@@ -494,6 +494,11 @@
global cleanup_mode
testnum = None
+ # Unset these so that the user's environment doesn't affect the tests
+ os.environ['SVN_EDITOR'] = ''
+ os.environ['VISUAL'] = ''
+ os.environ['EDITOR'] = ''
+
url_re = re.compile('^(?:--url|BASE_URL)=(.+)')
for arg in sys.argv:
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Python question [was: Re: svn commit: rev 6338 - in trunk/subversion: libsvn_client tests/clients/cmdline]
Posted by cm...@collab.net.
Philip Martin <ph...@codematters.co.uk> writes:
> Michael Wood <mw...@its.uct.ac.za> writes:
>
> >> + # Unset these so that the user's environment doesn't affect the tests
> >> + os.environ['SVN_EDITOR'] = ''
> >> + os.environ['VISUAL'] = ''
> >> + os.environ['EDITOR'] = ''
> >
> > I think you're looking for:
> >
> > del os.environ['blah']
>
> Ah, so that's how one does it, thanks! It turns out that my comment
> was inaccurate and unsetting the variables is not what I want.
> Instead, what I want to do is set SVN_EDITOR to something that will
> prevent an external editor being started, as that will override both
> .subversion/config and my environment.
>
> Any objections to this
(patch removed)
None here.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Python question [was: Re: svn commit: rev 6338 - in
trunk/subversion: libsvn_client tests/clients/cmdline]
Posted by Philip Martin <ph...@codematters.co.uk>.
Michael Wood <mw...@its.uct.ac.za> writes:
>> + # Unset these so that the user's environment doesn't affect the tests
>> + os.environ['SVN_EDITOR'] = ''
>> + os.environ['VISUAL'] = ''
>> + os.environ['EDITOR'] = ''
>
> I think you're looking for:
>
> del os.environ['blah']
Ah, so that's how one does it, thanks! It turns out that my comment
was inaccurate and unsetting the variables is not what I want.
Instead, what I want to do is set SVN_EDITOR to something that will
prevent an external editor being started, as that will override both
.subversion/config and my environment.
Any objections to this
Index: subversion/tests/clients/cmdline/svntest/main.py
===================================================================
--- subversion/tests/clients/cmdline/svntest/main.py (revision 6342)
+++ subversion/tests/clients/cmdline/svntest/main.py (working copy)
@@ -494,6 +494,10 @@
global cleanup_mode
testnum = None
+ # Explicitly set this so that no editor will be invoked irrespective
+ # of the user's environment or config settings.
+ os.environ['SVN_EDITOR'] = ''
+
url_re = re.compile('^(?:--url|BASE_URL)=(.+)')
for arg in sys.argv:
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Python question [was: Re: svn commit: rev 6338 - in trunk/subversion: libsvn_client tests/clients/cmdline]
Posted by Michael Wood <mw...@its.uct.ac.za>.
On Wed, Jun 25, 2003 at 12:53:37PM +0100, Philip Martin wrote:
> cmpilato@tigris.org writes:
>
> > * subversion/tests/clients/cmdline/basic_tests.py
> > (basic_mkdir_url): Add -m to the mkdir command so editors don't pop
> > up in people's faces when they run the test. :-)
>
> I've done this a couple of times now :( To prevent it happening again
> I want the test suite to override my SVN_EDITOR environment variable.
> What's the best way to do this? How about the following
>
> Index: subversion/tests/clients/cmdline/svntest/main.py
> ===================================================================
> --- subversion/tests/clients/cmdline/svntest/main.py (revision 6342)
> +++ subversion/tests/clients/cmdline/svntest/main.py (working copy)
> @@ -494,6 +494,11 @@
> global cleanup_mode
> testnum = None
>
> + # Unset these so that the user's environment doesn't affect the tests
> + os.environ['SVN_EDITOR'] = ''
> + os.environ['VISUAL'] = ''
> + os.environ['EDITOR'] = ''
> +
I think you're looking for:
del os.environ['blah']
--
Michael Wood <mw...@its.uct.ac.za>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org