0

I have programmed a customized deployment routine in .NET which does the following:

  1. Performs some previous checks on my code (among other things). This code is placed in a local folder.
  2. If all tests are OK it will then transfer this code to the production server.

Now, my question is: as a "previous check", I would like to test if my local folder contains the latest update from my Tortoise SVN repository. Is there any info in the .svn folders to check if an update is needed, or any other way to do so?

Xavier Peña
  • 7,399
  • 9
  • 57
  • 99

1 Answers1

1

Is there any info in the .svn folders to check if an update is needed

No

or any other way to do so?

Yes.

You have to use svn status -u ("show updates") from your app (if you have CLI svn-client) and check output.

From svn help status

   The out-of-date information appears in the ninth column (with -u):
      '*' a newer revision exists on the server
      ' ' the working copy is up to date

Sample:

>svn status -u wc
 M             965   wc/bar.c
        *      965   wc/foo.c
A  +             -   wc/qax.c
Status against revision:   981

wc/bar.c contains local modifications wc/foo.c updated in repository wc/qax.c added locally and sheduled for commit

in case of none local changes and repository changes

>svn status -u
Status against revision:     37

You will not get file-list, only status-line

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Than you very much for the hint. So now I have read have read about these functionalities [here](http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev.html). Then I decided that a good option was to test through errorCodes what is the state of my local folder: `process.Start() process.WaitForExit() Return process.ExitCode` The thing is that with this method I can know if a *commit* is necessary (with cmd="my_folder -n"), but not if an *update* is necessary... Furthermore, I can not find any "-u" option in the documentation. – Xavier Peña Jun 25 '13 at 12:43
  • OK, I gathered more information and now I see what I was missing. The first and more important piece is [this](http://stackoverflow.com/questions/1625406/using-tortoisesvn-via-the-command-line) (answer by AnneTheAgile): in tortoise, "command line client tools" is not installed by default. After installing them you can use svn.exe. So now your suggestion (svn status -u) works like a charm, thanks. – Xavier Peña Jun 25 '13 at 14:52