[darcs-users] setpref test and cwd

Daniel Gorín jcpetruzza at gmail.com
Tue Oct 23 13:43:16 UTC 2007


Hi

I can't figure out how to use 'darcs setpref test' correctly. What I  
want to do is simply run a script whose path is given relative to the  
root of my repository. This is a short transcription of what I get:

$ darcs --version
1.0.9 (release)
$ mkdir h
$ cd h
$ darcs init
$ echo "echo testing...." > my_test.sh
$ chmod +x my_test.sh
$ darcs setpref test "./my_test.sh"
Changing value of test from '' to './my_test.sh'
$ darcs record
[...mail stuff....]
changepref test

./my_test.sh
Shall I record this change? (1/?)  [ynWsfqadjkc], or ? for help: y
What is the patch name? a
Do you want to add a long comment? [yn]n
Running test...
/bin/sh: line 1: ./my_test.sh: No such file or directory
Test failed!
Looks like you have a bad patch: a.

To see what was going on, I made darcs print the cwd and dir content  
when executing the script:

$ darcs setpref test 'pwd;ls -la'
Changing value of test from './my_test.sh' to 'pwd;ls -la'
$ darcs record
changepref test

pwd;ls -la
Shall I record this change? (1/?)  [ynWsfqadjkc], or ? for help: y
What is the patch name? a
Do you want to add a long comment? [yn]n
Running test...
/private/tmp/testing
total 0
drwxr-xr-x   2 daniel  wheel   68 Oct 23 15:29 .
drwxrwxrwt   9 root    wheel  306 Oct 23 15:29 ..
Test ran successfully.
Looks like a good patch.
Finished recording patch 'a'

So, the problem seems to be darcs not running the test script from  
the repository. This is not the expected behaviour, is it? Am I doing  
anything wrong? I get this both on OS X and Linux

Thanks
Daniel


More information about the darcs-users mailing list