0

If I make small changes in let's say five different files and commit these to Subversion, how can I checkout just exactly these files in original folder structure to upload and overwrite on FTP Server later on?

If I try to check out HEAD non recursive I just get index.php and some different files which have nothing in common with last changes.


Attached solution: I made a small script - not very elegant but it works ...

#!/bin/bash
URL='http://svn ...';
TARGET='./ftp';

read -p "Please enter start revision: " VERSION1
read -p "Please enter ending revision: " VERSION2
read -p "Remove old? [yes] " remove

# getting changes
svn diff $URL --summarize -r$VERSION1:$VERSION2 > changes

# checkout complete revision
svn checkout  $URL -r HEAD

# remove previous
if [ $remove = 'yes'] ; then
if [ -d $TARGET ] ; then
    rm -r $TARGET   
else
    mkdir $TARGET   
fi
fi

for entry in `cat changes`; do
    e=${entry#*$URL/}
    item=$TARGET'/'$e;
    DIR=${item%/*} 

    # create directory
    if [ -d $DIR ] ; then
        echo '';
    else
        mkdir -p $DIR
    fi

    cp './trunk/'$e $DIR
    echo $e
done

echo "Done ..."
read any

It checks out the complete trunk and extracting the files which were changed in range of revisions given.

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • Id use [`rsync`](http://en.wikipedia.org/wiki/Rsync) with checksum (`-c`) comparison to transfer the files instead of FTP, that way it shouldnt matter - it will only replace whats changed. if its more complex than that you can always use specific includes or excludes. – prodigitalson Mar 06 '12 at 05:06
  • if you'll do diff on WC (No URL in diff) you already have checkouted repository and can copy files from WC (change order of commands, more correct - checkout outside script once, do svn up before svn diff) – Lazy Badger Mar 06 '12 at 11:19

2 Answers2

0

If you have full control of your server, you can svn checkout the particular repo path on the target server, and then run an svn update to acquire the latest files as needed.

Matt Beckman
  • 5,022
  • 4
  • 29
  • 42
0

In the root of existing working copy

svn diff --summarize -rN:M

and work with second column

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110