tag:blogger.com,1999:blog-6691429138293034846.post164154300229646532..comments2023-06-23T13:13:23.429+02:00Comments on Bits and pieces I'd like to share: Restore .svn in Keynote/Pages documentsDaniel A. Sadilekhttp://www.blogger.com/profile/16298618811307801255noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6691429138293034846.post-15820729575219306142009-02-26T15:37:00.000+01:002009-02-26T15:37:00.000+01:00Thanks to Daniel!I had a couple issues when I used...Thanks to Daniel!<BR/><BR/>I had a couple issues when I used his code: <BR/><BR/>1.) there were leftover svn files that needed to be cleaned up before his code could restore the svn directories.<BR/><BR/>2.) the version of subversion I was using was outdated and his code wasn't compatible. <BR/><BR/>Daniel was incredibly helpful and generous in assisting me with my problems (which likely arise from my lack of knowledge, rather than anything to do with his code).<BR/><BR/>The following is an excerpt of our dialogue:<BR/><BR/>Daniel:<BR/><BR/>"for the first problem you can look here: http://sadilek.blogspot.com/2008/02/remove-svn-folders.html.<BR/>The problem is that there are still some .svn folders inside the document folder.<BR/><BR/>Regarding the second problem, I assume that Cornerstone is a graphical client? The script uses the command line version of svn which seems to be outdated on your machine. You should update it. (I use the svn that comes with http://www.macports.org/)"<BR/><BR/>I actually ended up getting a new subversion from collab: http://www.collab.net/downloads/subversion/<BR/><BR/>Regarding the svn cleanup code he provided, I am currently trying to learn more about incorporating the terminal in my subversion workflow (I use Cornerstone as a gui), so I haven't successfully cleaned my folders yet, but am confident I will be able to after a little bit of study.<BR/><BR/>Thanks again Daniel!<BR/><BR/>-Joe S.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-6862305083704752062008-03-02T21:19:00.000+01:002008-03-02T21:19:00.000+01:00Excellent work! thank you much for sharing this, i...Excellent work! thank you much for sharing this, it saved me quite a long time of researching. It works great, however if you have an svn repository with many different files in Pages, Keynote, and Numbers, all in different directories, specifying each file that has been changed every time a commit is needed is not very practical.<BR/><BR/>I have modified your script to take care of this. What I do is I have the script on the 'root' of my svn checkout, and I just call the script from there and it will find every file that needs to be fixed inside of the checkout directory. At the top of the script is a variable called fix_extensions in which you can add more extensions that have this problem should anyone find anymore, the default is:<BR/><BR/>fix_extensions=(pages key numbers)<BR/><BR/>That takes care of everything from iWork, but I don't know if any other software has the same bug, so that way it's easy to add more extensions.<BR/><BR/>You can find the revised script here:<BR/><BR/><A HREF="http://misc.oscarferrer.com/fix_svn.sh" REL="nofollow">http://misc.oscarferrer.com/fix_svn.sh</A><BR/><BR/>Feel free to use it or modify it as you wish. Thanks again, and I hope my changes help someone else.<BR/><BR/>Oscar.Oscar Fhttps://www.blogger.com/profile/01024354054716023199noreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-38236449696870365782008-03-02T21:17:00.000+01:002008-03-02T21:17:00.000+01:00Dieser Kommentar wurde vom Autor entfernt.Oscar Fhttps://www.blogger.com/profile/01024354054716023199noreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-31724261275969362102008-02-19T17:55:00.000+01:002008-02-19T17:55:00.000+01:00Michael, you could try the updated version.Michael, you could try the updated version.Daniel A. Sadilekhttps://www.blogger.com/profile/16298618811307801255noreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-66608083472602503462008-01-20T14:41:00.000+01:002008-01-20T14:41:00.000+01:00Has anyone really gotten this to work? I tried ru...Has anyone really gotten this to work? I tried running it on an updated pages document directory, and only got errors :-(<BR/><BR/>[Tempelhuter:Documents/Services/Samples] czei% svnrecover wpi_load_testing_prices.pages<BR/>A wpi_load_testing_prices.pages<BR/>A wpi_load_testing_prices.pages/thumbs<BR/>A wpi_load_testing_prices.pages/thumbs/page_thumb_1-1.tiff<BR/>A wpi_load_testing_prices.pages/user_capacity.tiff<BR/>A wpi_load_testing_prices.pages/web_performance_baseline_bandwidth.jpg<BR/>A wpi_load_testing_prices.pages/index.xml.gz<BR/>A wpi_load_testing_prices.pages/web_perf_sample_summary.jpg<BR/>A wpi_load_testing_prices.pages/.typeAttributes.dict<BR/>A wpi_load_testing_prices.pages/Contents<BR/>A wpi_load_testing_prices.pages/Contents/PkgInfo<BR/>Updated to revision 195.<BR/>mv: rename wpi_load_testing_prices.pages/./thumbs/.svn to ___temp_svnRecover___/./thumbs/.svn: No such file or directoryMichael Czeiszpergerhttps://www.blogger.com/profile/11635137257032997850noreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-29152428198048494632007-10-13T02:12:00.000+02:002007-10-13T02:12:00.000+02:00I made my own script after having similar problems...I made my own script after having similar problems, should have just Googled first and found yours. I think we both are doing virtually the same work. I believe mine can handle spaces inside of the "packge" folder, if there happens to be any. It also handles spaces in the root folder.<BR/><BR/>The IFS variable is a BASH system variable for splitting words. I tried \n but that didn't seem to work as expected. It also has status messages echo'd out, which are totally unnecessary, but I like having them. Mine also checks to make sure that the recently updated path is still a directory, in case for some odd reason it doesn't exist in the latest revision or isn't a dir anymore (probably quite rare, I know, but just an extra step in checking).<BR/><BR/>Take what you want from it... <BR/><BR/>#!/bin/bash<BR/>IFS="<BR/>"<BR/><BR/># must be dir!<BR/>if [ ! -d "$1" ]<BR/>then<BR/> echo Path is not a directory.<BR/> exit<BR/>fi<BR/><BR/># get info<BR/>dir=`dirname "$1"`<BR/>base=`basename "$1"`<BR/><BR/># go to dir<BR/>cd "$dir"<BR/><BR/># prefix<BR/>prefix="tmp"<BR/>prefixi=1<BR/><BR/># does it exist?<BR/>while [ -x "$prefix.$base" ]<BR/>do<BR/> prefix="tmp$prefixi"<BR/> prefixi=$(( prefixi + 1 ))<BR/>done<BR/><BR/># move to temp<BR/>echo Moving to temp location<BR/>mv "$base" "$prefix.$base"<BR/><BR/># update<BR/>echo SVN Update<BR/>svn update -q "$base"<BR/><BR/># check to make sure it's a dir!<BR/>if [ ! -d "$base" ]<BR/>then<BR/> echo Updated path is not a folder! Restoring original!<BR/> mv "$prefix.$base" "$base"<BR/> exit<BR/>fi<BR/><BR/># go to dir<BR/>echo Moving .svn directories<BR/>cd "$base"<BR/><BR/># find .svn dirs<BR/>for foo in `find . -type d -name .svn`<BR/>do<BR/> if [ -d ../"$prefix.$base"/"`dirname "$foo"`" ]<BR/> then<BR/> # only move it if the folder exists in the modified version<BR/> mv "$foo" ../"$prefix.$base"/"`dirname "$foo"`"<BR/> fi<BR/>done<BR/><BR/># replace<BR/>echo Replacing<BR/>cd ..<BR/>rm -Rf "$base"<BR/>mv "$prefix.$base" "$base"Percyhttps://www.blogger.com/profile/06545856836726341807noreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-79366507962277241662007-09-25T21:00:00.000+02:002007-09-25T21:00:00.000+02:00It might be nice to have double quotes around all ...It might be nice to have double quotes around all $1 variables. This would allow using svnRestore in folders that have spaces in their name.<BR/><BR/>Here is a diff for them:<BR/>[1]Petri@laavu-zapto-org:bin $ diff -e svnRecover.1 svnRecover<BR/>19,20c<BR/>rm -rf "$1" && \<BR/>mv -f ___temp_svnRecover___ "$1"<BR/>.<BR/>16c<BR/> mv "$1/$i" ___temp_svnRecover___/$i<BR/>.<BR/>13,14c<BR/>svn update "$1" && \<BR/>(for i in `(cd "$1"; find . -name ".svn" -type d; cd ..)`; do <BR/>.<BR/>11c<BR/>mv "$1" ___temp_svnRecover___ && \<BR/>.Anonymoushttps://www.blogger.com/profile/17829989990360952980noreply@blogger.comtag:blogger.com,1999:blog-6691429138293034846.post-57434816456362212752007-09-25T20:32:00.000+02:002007-09-25T20:32:00.000+02:00Great work! This issue really should be addressed ...Great work! This issue really should be addressed in Subversion. Thanks for this workaround.<BR/><BR/>On the other hand, it would be interesting to implement a folder action or such, that would keep the .svn in place.<BR/><BR/>Or a filesystem that would allow zip files as folders. :)Anonymoushttps://www.blogger.com/profile/17829989990360952980noreply@blogger.com