<p>Is there a way to have a file that is modified / touched whenever the WC is updated to a new revision? Or, as the second-best option, whenever <code>svn update</code> is executed?</p>

<p>Here's the motivation: I want to have the SVN revision number inside my executable. So I have to run SubWCRev as part of the build. The output file of SubWCRev is re-created every time, even if the revision number has not changed. This means that the exe is linked on every build, even if nothing has changed. I want it to be linked only as needed.</p>

Get the SubWCRev output into a temporary file
Compare this file to the current revision-number file
Overwrite it with the temp file only if the two are different
Delete the temporary file
You might even be able to do this with a .bat file (using
```
fc
```
). Something like...
```
```
REM ***UNTESTED***
FC temp.rev curr.rev | FIND "FC: no dif" > nul 
IF NOT ERRORLEVEL 1 COPY /Y temp.rev curr.rev
DEL temp.rev
```
```
Edit:
As an aside, you can do this in Mercurial by making the rev-number-file depend on
```
.hg/dirstate
```
.