0

We have some externals definitions in our project. The externals are defined with a revision number (we want to keep it that way and don't want to use the head-revision).

What we are looking for is some kind of notification that is triggered when a newer revision for an external of that project is available. So that we know when we could (if we wanted to) switch to a newer revision of that external.

At the moment we're using the TortoiseSVN command line tools in a script, but that has some drawbacks.

Is there a tool or script that does what we want?

In case there is not which one is the better approch:

nobody
  • 19,814
  • 17
  • 56
  • 77
rherzog
  • 51
  • 9
  • 1
    The path we chose: We decided to use pysvn. Pysvn provides functionality to get svn properties. That allows to extract the defined external revision. The head revision of the referenced repository can also be determined. To update a working copy we use tortoise svn Client Tools. – rherzog Feb 25 '15 at 14:23

1 Answers1

0

Just concepts, which you can translate into code

If you have PEG-definition of external in form URL/OF/EXTERNAL@RevNo, you know URL of the latest revision: it will be URL/OF/EXTERNAL@HEAD or just URL/OF/EXTERNAL

In order to monitor changes, you can diff two URLs

Because you want to know fact of changes, you can call diff with --summarize option

>svn diff https://subversion.assembla.com/svn/subversion-troubleshoot-b/trunk@5 https://subversion.assembla.com/svn/subversion-troubleshoot-b/trunk@HEAD --summarize
 M      https://subversion.assembla.com/svn/subversion-troubleshoot-b/trunk

Here trunk@5 is revision from definition, not-empty output - sign of existing additional commits in linked repo, which you have to identify additionally, maybe with default diff

>svn diff https://subversion.assembla.com/svn/subversion-troubleshoot-b/trunk@5 https://subversion.assembla.com/svn/subversion-troubleshoot-b/trunk@HEAD
Index: .
===================================================================
--- .   (revision 5)
+++ .   (revision 7)
...

started with +++ string contain numeric value of HEAD

Another approach

If you have externals definition, f.e

>svn pl https://subversion.assembla.com/svn/subversion-troubleshoot-b/tags/1.0.1 -v
Properties on 'https://subversion.assembla.com/svn/subversion-troubleshoot-b/tags/1.0.1':
  svn:externals
    -r 2 https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib@2 lib

you can ls external and get revision of head (and compare it with definition's value)

>svn ls -v  https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib
      2 teno                  окт 17  2012 ./
      2 teno               23 окт 17  2012 lib01.txt

first column of string ./ contain HEAD-revision

No-coding way

Install CommitMonitor (for http-type repos), add all externals into it, control Monitor activity, check, check commit-logs

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110