Silviu
Silviu

Reputation: 103

SVN client with higher rev than server

Due to a human error, we had to restore svn data on server from a backup. The backup is 1 day old.

What happens when someone commits with a higher rev number than the server version? How should we mediate this problem?

Upvotes: 3

Views: 451

Answers (1)

sleske
sleske

Reputation: 83635

Just tested this with a local repository. I created a repository with a few commits, created a backup copy of the repository folder, added another commit, then replaced the repository folder with the old backup copy.

After restoring the repository to its old state (with an old revision), the behaviour is as follows:

  • Working copies with a newer revision will no longer be able to run svn update or svn log. They will get an error message: "svn: E160006: No such revision xxx".
  • However, the working copies will be able to send a new commit. The server will assign the commit the next SVN revision from its point of view - however, other working copies will not fetch this commit with svn up, since they already have a (different) commit with that revison number. Hence, working copies will diverge.

TL;DR:

This is not supported by Subversion. All existing working copies must be discarded (and checked out anew).

If working copies have uncommitted changes, these should be saved (e.g. using svn diff - but beware of limitations such as moved files) and re-applied to the fresh checkout.

Upvotes: 2

Related Questions