Re: Update on SoC proposal: git-remote-svn

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Michael Barr
Date: Wednesday, April 14, 2010 - 10:15 am

Hi Steve,


This stirred my thoughts and I whipped up a bash script that uses SVK,
find, shasum and ln to build a filesystem view of the root of an svn
repository that consumes moderate storage:

SVK_DEPOT=""
MAX_REV=12345

CO_DIR=validation
HASH_DIR=hashes

svk co -r1 /$SVK_DEPOT/ $CO_DIR
mkdir -p $HASH_DIR
for (( REV=1 ; REV<=MAX_REV ; ++REV )) do
  svk up -r$REV $CO_DIR
  # Hashify working copy
  find $CO_DIR -type d -cmin -5 -prune -o \
    -type f -links 1 -exec shasum '{}' + | (
    while read HASH FILE ; do
      [ -x "$FILE" ] && HASH="$HASH"x
      ln "$FILE" $HASH_DIR/$HASH 2>/dev/null || \
        ln -f $HASH_DIR/$HASH "$FILE"
    done
  )
done

Important assumptions are that each update will take less
than 5 minutes and that SVK uses writes to a temporary file
and then renames to perform a modification.
I've used this to build a simple validation script for my project.
I estimate it will use about 20GB to represent my 1GB repo
and that it will take about 3 hours.

--
David Barr
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Update on SoC proposal: git-remote-svn, Ramkumar Ramachandra, (Mon Apr 12, 10:29 pm)
Re: Update on SoC proposal: git-remote-svn, Sam Vilain, (Tue Apr 13, 1:34 am)
Re: Update on SoC proposal: git-remote-svn, Sverre Rabbelier, (Tue Apr 13, 9:01 am)
Re: Update on SoC proposal: git-remote-svn, Steven Michalske, (Tue Apr 13, 11:33 pm)
Re: Update on SoC proposal: git-remote-svn, David Michael Barr, (Wed Apr 14, 5:52 am)
Re: Update on SoC proposal: git-remote-svn, David Michael Barr, (Wed Apr 14, 10:15 am)