[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: No such revision - how to fix?

From: Ryan Schmidt <subversion-2005_at_ryandesign.com>
Date: 2005-08-08 11:55:00 CEST

On 08.08.2005, at 04:10, Kevin Horton wrote:

> If I try to commit a change, I get a response like:
> Sending sip/sip.info
> svn: Commit failed (details follow):
> svn: File not found: transaction '4-1', path '/sip/sip.info'
> If I dig a bit deeper, I see:
> % svn log
> svn: No such revision 5
> I didn't think about svn during the OS upgrade, and I didn't get a
> backup of the svn repository, but I did get a backup of my working
> copy. I later restored the latest svn backup I had, so I think the
> source of my problem is that the working copy is "newer" than my
> current repository. What is the best way to get svn working again,
> while keeping the various newer files that are in my working copy,
> while keeping the older versions that are in the repository?

I'd fix it this way:

1) Create an export of your "old" working copy (which has all the
data in it that you want).
2) Create a new working copy from the repository.
3) Create an export of your "new" working copy (which is missing the
newest revisions).
4) Create a diff (not an svn diff; just a normal diff) between the
"new" export and the "old" export.
(I suggest diffing exports, because if you diff working copies,
you'll diff the .svn directories too which you need to avoid.)
5) Apply this diff to the "new" working copy.
6) Commit.
7) Throw away the exports and the "old" working copy.

I just recreated the problem here and the solution seems to work:

$ cd /path/to/wc-of-lost-repo
$ svn log
svn: No such revision 3
$ svn co file:///path/to/restored-repo /path/to/new-wc
A /path/to/new-wc/foo
Checked out revision 2.
$ svn export /path/to/wc-of-lost-repo /path/to/export-of-lost-repo
Export complete.
$ svn export /path/to/new-wc /path/to/new-export
Export complete.
$ cd /path/to/new-wc
$ diff -ru /path/to/new-export /path/to/export-of-lost-repo | patch
patching file foo
$ svn ci -m "Restoring work lost in the OS upgrade fiasco."
Sending foo
Transmitting file data .
Committed revision 3.

In my example I only lost 1 revision, so my revisions match up in the
end; if you lost more than one, then your "new" working copy will
still be several revision numbers short of where you were with the
old repository. Either way, you should not use any old working copies
of the old repository anymore, as they'll be out of sync with the
restored older repo.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 8 11:56:53 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.