tags:

views:

47

answers:

1

In my build system, I delete my working copy and perform a fresh checkout in order to guarantee that the working copy is pristine.

By 'pristine' I mean I can be sure there's nothing additional, as well as nothing changed or missing, in the working copy.

Is there a more efficient way to do this?

+3  A: 

First do an svn up, then a svn status. If there are no changes shown - your copy is pristine. And there isn't the overhead of downloading everything each time...

Bozhidar Batsov
I do the same thing, but do a `svn revert` before `svn up`.
Avi
This doesn't guarantee there are no additional, unversioned items in the working copy.
Pete Montgomery
It does - if you don't see entries starting with "?" - there are no unversioned item is the working copy, so I think it's good enough solution
Bozhidar Batsov
You need to get rid of ignored files also (`svn status --no-ignore | awk '$1 == "I" { print $2 }' | xargs rm -r`).
Randy Proctor
Thanks Bozhidar - I think svn status would work, but I need a mechanical way to determine if there are any relevant status changes. I wonder if somehow parsing the output and failing if anything other than X (externals) are reported would do the trick...
Pete Montgomery