[PATCH 01 of 14] tests: roll test-committer.t into test-commit.t

Adrian Buehlmann adrian at cadifra.com
Fri Jun 8 15:05:05 CDT 2012


On 2012-06-08 21:53, Adrian Buehlmann wrote:
> On 2012-06-08 21:23, Idan Kamara wrote:
>> On Fri, Jun 8, 2012 at 9:59 PM, Adrian Buehlmann <adrian at cadifra.com
>> <mailto:adrian at cadifra.com>> wrote:
>>>
>>> On 2012-06-08 20:56, Adrian Buehlmann wrote:
>>>> then check that it isn't higher than $TESTTMP. Nowhwere.
>>>
>>> Wow, that's an ugly spelling error, sorry. Should be: Nowhere.
>>
>> I actually think you meant everywhere ;) If that's the case then
>> cd'ing on every $ line sounds like overkill. Not to mention the
>> slowdown it will cause.
> 
> cd-ing on every line? No.
> 
> The idea was, doing something like:
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -578,7 +578,7 @@
>          if inpython:
>              script.append('%s %d 0\n' % (salt, line))
>          else:
> -            script.append('echo %s %s $?\n' % (salt, line))
> +            script.append('echo %s %s $? "`pwd`"\n' % (salt, line))
> 
>      # After we run the shell script, we re-unify the script output
>      # with non-active parts of the source, with synchronization by our
> 

Or wait, perhaps instead we could use $PWD:

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -578,7 +578,7 @@
         if inpython:
             script.append('%s %d 0\n' % (salt, line))
         else:
-            script.append('echo %s %s $?\n' % (salt, line))
+            script.append('echo %s %s $? "$PWD"\n' % (salt, line))

     # After we run the shell script, we re-unify the script output
     # with non-active parts of the source, with synchronization by our


I think $PWD should be pretty fast. Isn't that a shell built-in?

But I think not every shell might have that. Perhaps a single check
whether $PWD is available would be needed. If it isn't, then the PWD
check isn't done.


More information about the Mercurial-devel mailing list