-1

Is there a way or method to do an export of between two revisions to a physical directory?

In this way, the result expected is to have only files, changed between the specified revisions.

Lazy Badger
  • 87,730
  • 7
  • 72
  • 97
Geddon
  • 1,136
  • 1
  • 10
  • 27
  • possible duplicate of [How to overwrite several multi-level(different hierarchy) files from a local version to an online version via FTP](http://stackoverflow.com/questions/13058444/how-to-overwrite-several-multi-leveldifferent-hierarchy-files-from-a-local-ver) – Lazy Badger Dec 04 '12 at 20:14

2 Answers2

1

You can only check out individual revisions. What you are probably looking to do is export only the files changed between 2 revisions. Pseudocode:

svn diff --summarize -rSTART:END
for each item
   svn export URL_TO_ITEM LOCAL_PATH
alroc
  • 26,170
  • 5
  • 45
  • 88
  • `svn diff --summarize` lists all paths (relative to the current directory, if used in a working copy) changed in the revision/revision range. It'll require less parsing of the output than `svn log -v` – alroc Dec 04 '12 at 21:23
  • I did thought about using the svn diff, BTW which will definitely identify the changes made between those revisions, but the issue is with svn export. The svn exports, takes the file from the repository and places the contents into a new file..This is not what I am looking for. I am trying to check out only the changes between two revisions and maintain the folder structure of the branch. I was thinking along the lines of branch folder along with its subfolders would be checked out and the contents will only be the files changed between revisions. If that's possible it will be sweet !!! – Geddon Dec 05 '12 at 14:04
  • 1
    What would be the purpose of "checking out only the changes"? Perhaps if you explain the problem you're trying to solve, instead of the solution you're looking for, better guidance can be offered. You could do a sparse checkout & update only the items that changed, but that would be time-consuming (script it for sure, but it'll still take a lot of time to run). – alroc Dec 05 '12 at 14:11
  • Getting the checkout files while maintaining the folder structure and I better able to manipulate them for a number of reasons. One being creating db patches. Do you have a documentation on sparse checkout & updates. I can look into that to see if this may be what I am looking for. – Geddon Dec 05 '12 at 14:22
  • For creating patches, can't you just use svn diff? That's what it's designed for. [Sparse directory info](http://svnbook.red-bean.com/en/1.7/svn.advanced.sparsedirs.html) (that's a link - always look to the SVN manual for answers) - then use `svn update` to update the items you need (see my pseudocode above) – alroc Dec 05 '12 at 14:38
  • Thanks. I can use svn diff, in fact I have used it to create simple patches before. But given the structure and complexitly of my database files now within svn it was proven difficult to get the right results..If I have only the changed files checked out, I personally will find it easier to manipulate them to get the correct patches I want. But I guess there is also no straight fwd way of doing this either. – Geddon Dec 05 '12 at 16:01
0

BTW: These are the steps I took to accomplish this:

  1. svn diff --summarize -r START:END Branch_URL > c:\diff.txt
  2. Alter diff.txt via a script to get only the Modified and Added files, and change the slashes for windows paths.
  3. Perform an svn checkout for each $line in the $file

Although there is not direct way to do this in svn (which I think it should have), this is a suggested work around.

Thanks.

Geddon
  • 1,136
  • 1
  • 10
  • 27
  • Is that not essentially what I posted? How are you working around the fact that you cannot check out individual files? – alroc Jan 25 '13 at 14:31
  • My Apologies, the only difference was the use of the svn checkout as oppose to using svn export. Your answer was very useful and it is also a working solution to my question and gave you an “upvote” for it. I had no intentions on checking out an individual file, but rather checking out file/s between 2 revisions. With the use of the script I wrote and the svn diff I am able to accomplish this, and I suppose using the svn checkout or svn export at that point will give the same results. Because of this I will re-instate your answer as the correct one. Thanks for your help. – Geddon Jan 29 '13 at 18:19