Doing this is major surgery on your repository. Make sure you're fully aware of what you're doing before doing this for real on a real repository.
You won't be able to do what you're after for individual files, but you can do this across the whole repository. What you need to do is cut off the history tail for the repository.
What this means is that if you've got 5000 revisions in your repository, and you cut off the oldest 1000 revisions, you'll end up with a repository with just the most recent 4000 revisions.
Doing this requires a dump/restore cycle, which means that you'll have to disable write access to the repository whilst you're working on and rebuilding the repository.
You won't lose any files that are still visible when browsing the repository, but the history for any particular file may be lost entirely (if all modifications to it were in the first 1000 revisions). Obviously if a file was deleted in one of the early revisions, you won't be able to get it back at all after the cut.
Also note that the naive way of doing this will renumber all of your revisions starting from 0, so in the above example, revision 5000 will become revision 4000 after the truncation. If this will cause you problems, you'll have to do extra work.
So, assuming we want to lose the earlist 1000 revisions, the basic workflow is:
- Take your repository offline (or at least make it read-only)
- run "svnadmin dump [repository path] -r 1000:HEAD >repository.dump". This will create a dumpfile which only includes revisions from 1000 onwards. By not using the --incremental flag, the first revision in the dumpfile will contain a complete dump of the repository as it looked at revision 1000 (excluding all history).
- Create a clean repository with "svnadmin create" and copy the conf & hooks directories from the old repository.
- run "svnadmin load [new repository path] < repository.dump" to load up the most recent revisions.
- Move the old repository out of the way (keep it around for backup) and move the new repository into its place.
If you want to preserve the revision numbers you'll have to load the empty revisions from somewhere. You can do that by dumping out the revisions 1:999 into a separate dump file and then using svn dumpfilter to get rid of everything from it, then load up the empty revisions followed by the revisions you want. It's a bit fiddly, but will get you there.