altendky
altendky

Reputation: 4354

svnversion output but recursive over externals

I am trying to identify local (not automated build server) builds of SVN projects with externals (and sub-externals) by their URL, revision, and dirty/clean status. The overall result will simply be all clean or something somewhere is dirty, I do not care what is dirty. Is such a program/script already handy? Or must I be less lazy and write it myself... (I have been unlazy enough to search a bit). In short, a fancy version of svnversion which is aware of externals.

I have tried svnversion. Here is a redacted copy from my Cygwin shell.

altendky@ly /svn/myProject.clean
$ svnversion
606

altendky@ly /svn/myProject.clean
$ svn propget svn:externals
^/../the_canopen_library@223 libs/canopen

altendky@ly /svn/myProject.clean
$ echo blue >> libs/canopen/wrapper/CANOpenGuard.c

altendky@ly /svn/myProject.clean
$ svnversion
606

altendky@ly /svn/myProject.clean
$ echo blue >> src/App_Main.c

altendky@ly /svn/myProject.clean
$ svnversion
606M

altendky@ly /svn/myProject.clean
$ svnversion --version
svnversion, version 1.8.3 (r1516576)
   compiled Aug 30 2013, 11:03:40 on i686-pc-cygwin

Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

altendky@ly /svn/myProject.clean
$

Upvotes: 3

Views: 339

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97285

Did you try to read svnversion -h and test WC with externals? I see - no, because presence or absence of exernals inside WC does change nothing in result

The version identifier will be a single number if the working copy is single revision, unmodified, not switched and with a URL that matches the TRAIL_URL argument. If the working copy is unusual the version identifier will be more complex

For clean checkout of repo-URL with externals inside

>dir /B
core_mod.txt
lib

(lib is directory-externals in foreign repo)

svnversion for the root of WC generates, as expected

>svnversion
7

In case of any modifications inside WC, which will destroy "vanilla" state, version identity will be more complex than pure single number:

A[:B[MSP]]

Upvotes: 1

Related Questions