Update svn checkout to specific date including externals

I hope, anybody will implement my common-sense logic (limited to directory-type externals in some areas) into bash and cmd-script sooner or later and we'll get "definitive answer" to this repeating question

Your base task is:

  • svn up your super-repo to needed point in past (updating to date /and without time/ is, BTW, not a best choice, but - apllicable)
  • get list of paths to all externals in your project (because externals definitions can exist anywhere in tree), from WC-root svn propget svn:externals -R (-R in order to check the whole tree without a lot of cd)
  • for each string in propget output (with format like this . - https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib lib): cd to the last field of string /relative to the first field, which is, in turn, is relative path to root/ and svn up to the same point, as it was done for superrepo: svn update -r {2010-10-17}

As result you'll have Mixed Working Copy, but superrepo and externals will be in state "for some revision in the past"

Note:

Additional sample for constructing local path to directory with externals (nested WC really) on more complex case.

For

>svn propget svn:externals -R
tags\1.0.1 - -r 2 https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib@2 lib

trunk - https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib lib

finals paths to externals in my WC will be (relative to WC-root)

tags\1.0.1\lib
trunk\lib