rookie
rookie

Reputation: 7863

explanations about the code

I have some script and I have no idea what it is doing, will be happy if somebody will explain me:

#!/bin/tcsh

if (-d test) then
    svn up test
else
    svn checkout http:some address test
endif

cd tests
python test_some.py $argv

P.S can't find info about functions cd and svn

thanks in advance for any help

Upvotes: 0

Views: 63

Answers (4)

DigitalRoss
DigitalRoss

Reputation: 146043

The script runs a second revision-controlled test script


This script runs a python program which appears to run some tests. The script understands that the test directory is stored in a subversion repository.

  • If there is a test directory, it updates it in case it has been changed in the repository, perhaps by another svn user or by the same user in a different working directory.
  • If there is no test directory, it checks it out.
  • Then it changes its current directory to the working directory.
  • Then it runs the test script.

I'm a bit confused about one thing. It checks out "test" but then changes its directory to "tests". So either there is a transcription error in the original post or something slightly more complex is going on, like, it somehow assumes that tests exists but not test.

Upvotes: 1

Jeff
Jeff

Reputation: 337

cd, and svn, and python are executable names. cd is the command for changing current directory. svn is the command (executable name) for Subversion source control system. python is the Python language interpreter.

Upvotes: 0

The script does the following:

if the test folder exists
    update it through subversion
else
    check it out from subversion repository

go into the tests directory // interestingly enough, it doesn't match the checked out directory name?
run the test_some.py python file, passing the script arguments.

Upvotes: 0

Andrew Cooper
Andrew Cooper

Reputation: 32576

cd is the "Change Directory" command.

svn is a source code repository client.

Upvotes: 0

Related Questions