I am writing a shell script which can store the actual state of a SVN working copy and restore it later, exactly as it was. Currently I have a problem with specific, rare combination of revisions of files and directories which seems to be undetectable.
Let's say that there is a repository with two revisions. There are two cases:
Assume that
foo
is a file (or a directory) that exists only in revision 2. At the beginning the whole working copy is at revision 2. Thenfoo
(and onlyfoo
) is updated to revision 1.Assume that
bar
is a file (or a directory) that exists only in revision 1. At the beginning the whole working copy is at revision 1. Thenbar
(and onlybar
) is updated to revision 2.
The both cases are very similar but it seems that they have different solutions. In both cases the file (or directory) simply vanishes. However, output of command svn status
contains no information about that.
How to create by a shell script a list of such files and directories?
There is one simple but bad solution. It is possible to use command svn list
to get a list of files that should exist in current revision and compare it to the list of files that really exist.
This solution is unacceptable because it takes a lot of time and generates a big traffic to the server.
I posted the best answer that I can come up with. Still, it works only for the first case and has false-positives.