Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn copy -r [revision number] [url] [path]

Tags:

So, I've done this before and I just can't seem to figure out what's broken this time...

I'm trying to restore a file from SVN. I went and found the revision where it was deleted (or at least last existed. I verified by using svn list -r)

Here is my command:

svn copy -r 925 url/to/repo/foldername htdocs/foldername

I keep getting an error:

svn: '/!svn/bc/973/.../htdocs/templates' path not found

From my understanding that means its looking in revision 973 (which is HEAD) instead of 925.

What am I missing here?

like image 587
matmer Avatar asked Jul 06 '11 05:07

matmer


People also ask

How do I find my svn revision number?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

How do I find my svn repository path?

http:// or https:// This is svn over http or https. You need to find the virtual host in your apache configuration and look for a <Location> section that matches your url path and look for a SVNPath or SVNParentPath config line. This will tell you the location of your subversion repository.

What is svn revision number?

As you saw in the section called “Revisions”, revision numbers in Subversion are pretty straightforward—integers that keep getting larger as you commit more changes to your versioned data. Still, it doesn't take long before you can no longer remember exactly what happened in each and every revision.

How do I tag a revision in svn?

If you want to create a snapshot of /calc/trunk exactly as it looks in the HEAD revision, make a copy of it: $ svn copy http://svn.example.com/repos/calc/trunk \ http://svn.example.com/repos/calc/tags/release-1.0 \ -m "Tagging the 1.0 release of the 'calc' project." Committed revision 902.


1 Answers

I think what you want is:

svn copy url/to/repo/foldername@925 htdocs/foldername

From svn help copy:

usage: copy SRC[@REV]... DST

See Peg and Operative Revisions.

Using -r REV without @REV means "the ancestor (revision REV) of the current file" while @REV without -r rev means "the file at REV". This semantic difference is significant because svn tracks copies (and renames).

like image 179
Flimzy Avatar answered Sep 29 '22 04:09

Flimzy