<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: subversion code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 02:16:06 GMT</pubDate>
    <description>DZone Snippets: subversion code</description>
    <item>
      <title>rails-commit: Rails Commit Script for Subversion</title>
      <link>http://snippets.dzone.com/posts/show/5636</link>
      <description>#!/usr/bin/env ruby&lt;br /&gt;&lt;br /&gt;# my take on a easy commit script for rails...&lt;br /&gt;# it is far from prefect, so:&lt;br /&gt;# please feed back the modifications you made to it!&lt;br /&gt;#&lt;br /&gt;# Fixed bugs on empty to_ arrays and spelling mistakes&lt;br /&gt;# by Vesa-Pekka Palmu&lt;br /&gt;# orginal by Cies Breijs -- cies.breijsATgmailDOTcom&lt;br /&gt;# based on a bash script by Anonymous Gentleman&lt;br /&gt;# found here: &lt;a href="http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion"&gt;http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion&lt;/a&gt;&lt;br /&gt;# cleaned up an pasted by Ed Laczynski http://idisposable.net &lt;br /&gt;&lt;br /&gt;to_add = []&lt;br /&gt;to_remove = []&lt;br /&gt;to_checkin = []&lt;br /&gt;&lt;br /&gt;`svn status`.each_line do |l|&lt;br /&gt;  puts l&lt;br /&gt;  action_char, path = l.split(' ', 2)&lt;br /&gt;  path.strip!&lt;br /&gt;  case action_char&lt;br /&gt;    when '?'&lt;br /&gt;      to_add &lt;&lt; path&lt;br /&gt;    when '!'&lt;br /&gt;      to_remove &lt;&lt; path&lt;br /&gt;    when 'M'&lt;br /&gt;      to_checkin &lt;&lt; path&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts "\nyou are about to" &lt;br /&gt;&lt;br /&gt;def print_list(array, str)&lt;br /&gt;  puts "\n#{str}:"&lt;br /&gt;  array.each { |i| puts "\t"+i }&lt;br /&gt;  puts "\t&lt;nothing&gt;" if array.length == 0&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;print_list(to_add, 'add')&lt;br /&gt;print_list(to_remove, 'remove')&lt;br /&gt;print_list(to_checkin, 'checkin')&lt;br /&gt;&lt;br /&gt;puts "\nplease write something for the commit log and hit enter"&lt;br /&gt;puts "(hitting enter on an empty line will cancel this commit)\n\n" &lt;br /&gt;&lt;br /&gt;log = gets.strip&lt;br /&gt;&lt;br /&gt;if log.empty?&lt;br /&gt;  puts "commit cancelled!\n"&lt;br /&gt;  exit&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts "\ncontacting repository\n" &lt;br /&gt;&lt;br /&gt;`svn add #{to_add.join(' ')}` unless to_add.empty?&lt;br /&gt;`svn remove #{to_remove.join(' ')}` unless to_remove.empty?&lt;br /&gt;puts "\n" + `svn commit -m "#{log.gsub('"', '"')}"` + "\n" &lt;br /&gt;&lt;br /&gt;puts "running \'svn update\' to be sure we are up-to-date"&lt;br /&gt;puts `svn update`&lt;br /&gt;&lt;br /&gt;puts "\nfinished.\n"&lt;br /&gt;</description>
      <pubDate>Wed, 11 Jun 2008 21:23:20 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5636</guid>
      <author>edltech (Ed Laczynski)</author>
    </item>
    <item>
      <title>Copy all svn:* properties from one file to another</title>
      <link>http://snippets.dzone.com/posts/show/5501</link>
      <description>The following script can be used to copy all SVN properties from one file (presumably a file that's already under SVN control) to another file (which you presumably want to put under SVN control, and which you want to check in with the same SVN properties).&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;ORIG=$1 ; shift ;&lt;br /&gt;[ -e "$ORIG" ] || exit ;&lt;br /&gt;&lt;br /&gt;for PROP in `svn pl "$ORIG" | sed -n '2,$p'` ; do&lt;br /&gt;        VALUE=`svn pg $PROP "$ORIG"` ;&lt;br /&gt;        for FILE ; do&lt;br /&gt;                [ -e "$FILE" ] &amp;&amp; svn ps $PROP "$VALUE" "$FILE" ;&lt;br /&gt;        done&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;# That's it, Folks!&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you put the above code in a shell script called...&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;svnprops.sh&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;... then you can run it as follows if you want to copy all svn:* properties FROM original.file TO blegga:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pvdb@localhost ~ $ ./svnprops.sh original.file blegga &lt;br /&gt;property 'svn:mime-type' set on 'blegga'&lt;br /&gt;property 'svn:eol-style' set on 'blegga'&lt;br /&gt;pvdb@localhost ~ $ _&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;... or as follows for multiple target files:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pvdb@localhost ~ $ ./svnprops.sh another.original.file blegga foo bar &lt;br /&gt;property 'svn:mime-type' set on 'blegga'&lt;br /&gt;property 'svn:mime-type' set on 'foo'&lt;br /&gt;property 'svn:mime-type' set on 'bar'&lt;br /&gt;pvdb@localhost ~ $ _ &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Fri, 16 May 2008 11:25:10 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5501</guid>
      <author>pvdb (Peter Vandenberk)</author>
    </item>
    <item>
      <title>SVN Diff While Ignoring Whitespace</title>
      <link>http://snippets.dzone.com/posts/show/5215</link>
      <description>A command line alias for doing an svn diff while ignoring whitespace differences. Placed in ~/.bashrc or your profile.&lt;br /&gt;&lt;br /&gt;Can be used in a directory:&lt;br /&gt;$ dw&lt;br /&gt;&lt;br /&gt;Or on a single file:&lt;br /&gt;$ dw functions.php&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;alias dw="svn diff --diff-cmd diff -x -uw"&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:42:46 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5215</guid>
      <author>philsown (Phil)</author>
    </item>
    <item>
      <title>Ruby script for performing checkout in Subversion</title>
      <link>http://snippets.dzone.com/posts/show/5087</link>
      <description>This Ruby script checkouts Subversion repositories. If during checkout it encounters two or more externals that point to the same directory, that directory is only downloaded once and symbolic links are created where appropriate, avoiding duplication. It requires the Ruby Subversion bindings.&lt;br /&gt;&lt;br /&gt;This is my first Ruby program.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/env ruby&lt;br /&gt;&lt;br /&gt;require 'optparse'&lt;br /&gt;require 'ostruct'&lt;br /&gt;require 'uri'&lt;br /&gt;require 'pathname'&lt;br /&gt;require 'fileutils'&lt;br /&gt;require 'svn/repos'&lt;br /&gt;&lt;br /&gt;class Checkout  &lt;br /&gt;	attr_accessor :url, :pathname, :revision&lt;br /&gt;&lt;br /&gt;	def initialize(url,pathname, revision=nil)&lt;br /&gt;		@url = url&lt;br /&gt;		@pathname = pathname  &lt;br /&gt;		@revision = revision&lt;br /&gt;	end&lt;br /&gt;&lt;br /&gt;	def perform(ctx)&lt;br /&gt;		ctx.checkout @url, @pathname.to_s, @revision, nil, true, true&lt;br /&gt;		proppy = (ctx.propget "svn:externals", @url)[@url]&lt;br /&gt;&lt;br /&gt;		if proppy==nil&lt;br /&gt;			proppy=[]&lt;br /&gt;		else&lt;br /&gt;			lines = proppy.split "\n"&lt;br /&gt;&lt;br /&gt;			lines.map { |line|&lt;br /&gt;				splitted = line.split " "&lt;br /&gt;				sub_path= Pathname.new(splitted.shift)&lt;br /&gt;				sub_url= splitted.pop&lt;br /&gt;				sub_revision= nil&lt;br /&gt;&lt;br /&gt;				if !splitted.empty?&lt;br /&gt;					revnumber_string = splitted.shift.scan(/[0-9]+/).shift&lt;br /&gt;					sub_revision = revnumber_string.to_i&lt;br /&gt;				end&lt;br /&gt;&lt;br /&gt;				Checkout.new(sub_url,@pathname.join(sub_path),sub_revision)		&lt;br /&gt;			}&lt;br /&gt;		end&lt;br /&gt;	end&lt;br /&gt;end  &lt;br /&gt;&lt;br /&gt;def parse_args(args)&lt;br /&gt;	options = OpenStruct.new&lt;br /&gt;&lt;br /&gt;	options.revision = nil;&lt;br /&gt;&lt;br /&gt; 	opts = OptionParser.new do |opts|&lt;br /&gt;        	opts.banner = "Usage: example.rb URL [PATH]"&lt;br /&gt;&lt;br /&gt;        	opts.separator ""&lt;br /&gt;        	opts.separator "Valid options:"&lt;br /&gt;&lt;br /&gt;        	# Mandatory argument.&lt;br /&gt;        	opts.on("-r", "--revision arg","Revision number") do |rev|&lt;br /&gt;          		options.revision = rev.to_i&lt;br /&gt;		end&lt;br /&gt;&lt;br /&gt;		opts.on_tail("-h", "--help", "Show this message") do&lt;br /&gt;			puts opts&lt;br /&gt;			exit&lt;br /&gt;        	end&lt;br /&gt;	end&lt;br /&gt;&lt;br /&gt;	opts.parse!(args)&lt;br /&gt;&lt;br /&gt;	if args.empty?&lt;br /&gt;		print "Repository URL needed", "\n"&lt;br /&gt;		exit&lt;br /&gt;	end&lt;br /&gt;&lt;br /&gt;	options.url = args.shift&lt;br /&gt;&lt;br /&gt;	if !args.empty?&lt;br /&gt;		options.pathname = Pathname.new(args.shift)&lt;br /&gt;	else&lt;br /&gt;		uri = URI.parse(options.url)&lt;br /&gt;		options.pathname = Pathname.new(uri.path).basename&lt;br /&gt;	end&lt;br /&gt;	&lt;br /&gt;	if !args.empty?&lt;br /&gt;		print "Too many arguments", "\n"&lt;br /&gt;		exit&lt;br /&gt;	end&lt;br /&gt;&lt;br /&gt;	Checkout.new(options.url,options.pathname,options.revision)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# we parse the args&lt;br /&gt;initial_checkout = parse_args(ARGV)&lt;br /&gt;&lt;br /&gt;# we create a client context&lt;br /&gt;ctx = Svn::Client::Context.new&lt;br /&gt;ctx.add_simple_provider&lt;br /&gt;homedir=ENV['HOME']&lt;br /&gt;ctx.auth_baton[Svn::Core::AUTH_PARAM_CONFIG_DIR] = "#{homedir}/.subversion"&lt;br /&gt;# ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_USERNAME] = "foouser"&lt;br /&gt;# ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_PASSWORD] = "foopasswd"&lt;br /&gt;&lt;br /&gt;# we initialize the data structures&lt;br /&gt;checkout_queue = [initial_checkout]&lt;br /&gt;pathname_cache = {}&lt;br /&gt;&lt;br /&gt;# we traverse the tree&lt;br /&gt;while !checkout_queue.empty?&lt;br /&gt;	checkout = checkout_queue.shift&lt;br /&gt;&lt;br /&gt;	cached_path = pathname_cache[checkout.url]&lt;br /&gt;&lt;br /&gt;	if cached_path==nil&lt;br /&gt;		colist = checkout.perform ctx&lt;br /&gt;		colist.each { |co| checkout_queue.push co }&lt;br /&gt;		pathname_cache[checkout.url] = checkout.pathname&lt;br /&gt;&lt;br /&gt;		puts "check out #{checkout.url} -&gt; #{checkout.pathname}"&lt;br /&gt;	else&lt;br /&gt;		relative_path=cached_path.relative_path_from(checkout.pathname.dirname)&lt;br /&gt;		FileUtils.ln_sf(relative_path, checkout.pathname)&lt;br /&gt;&lt;br /&gt;		puts "link #{cached_path} -&gt; #{checkout.pathname}"&lt;br /&gt;	end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 02 Feb 2008 09:53:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5087</guid>
      <author>marmolubio7 (Tim R. Mortiss)</author>
    </item>
    <item>
      <title>Checkout a Git clone of an SVN repository in parent folder</title>
      <link>http://snippets.dzone.com/posts/show/4813</link>
      <description>Here is a quick executable cmd that you run inside a folder checked out with Subversion. It will clone the repository using Git into the parent folder as &amp;lt;projname&amp;gt;.git&lt;br /&gt;&lt;br /&gt;Stick this code into ~/bin/gitify and add ~/bin to your path:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/env ruby -wKU&lt;br /&gt;&lt;br /&gt;# get svn info location&lt;br /&gt;svnurl = `svn info | grep "^URL:"`.gsub('URL: ','').chomp&lt;br /&gt;&lt;br /&gt;# project = basename&lt;br /&gt;project = File.basename(Dir.pwd)&lt;br /&gt;&lt;br /&gt;puts cmd = "git-svn clone #{svnurl} ../#{project}.git"&lt;br /&gt;&lt;br /&gt;`#{cmd}`&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 22 Nov 2007 22:35:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4813</guid>
      <author>nicwilliams (Dr Nic Williams)</author>
    </item>
    <item>
      <title>Subversion basic commands Part II</title>
      <link>http://snippets.dzone.com/posts/show/4707</link>
      <description>This code shows how to checkout, commit, and verify the changes to a project file in subversion. See also Subversion basic commands part 1 http://urltea.com/1urp . The Subversion Online book can be read here http://svnbook.red-bean.com/&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# get the project to edit&lt;br /&gt;svn checkout http://mysite.com/svn/my-repository/my-project&lt;br /&gt;&lt;br /&gt;#add a new file to the project&lt;br /&gt;svn add feed/changelog&lt;br /&gt;&lt;br /&gt;# commit the changes to the repository&lt;br /&gt;svn commit feed&lt;br /&gt;&lt;br /&gt;# check to see that the actual changes have been committed.&lt;br /&gt;svn cat &lt;br /&gt;http://mysite.com/svn/my-repository/my-project/trunk/gwd/feed/gwd.rb&lt;br /&gt;&lt;br /&gt;#remove the local project files&lt;br /&gt;rm my-project -Rf&lt;br /&gt;&lt;br /&gt;#get the project files without version control&lt;br /&gt;svn export http://mysite.com/my-repository/my-project/trunk/gwd&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Sat, 27 Oct 2007 21:18:31 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4707</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Subversion basic commands Part I</title>
      <link>http://snippets.dzone.com/posts/show/4689</link>
      <description>New users to SVN should be familiar with the following commands.  Examples based on the code from Gentoo-wiki - HOWTO subversion SVN http://urltea.com/1urj . &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#server side&lt;br /&gt;&lt;br /&gt;# create the project directory structure outside of svn&lt;br /&gt;mkdir -p ~/Documents/code/my-project/{trunk,tags,branches} &lt;br /&gt;&lt;br /&gt;# create the new repository&lt;br /&gt;svnadmin create /var/svn/my-repository &lt;br /&gt;&lt;br /&gt;# add the new project&lt;br /&gt;svn import my-project file:////var/svn/my-repository/my-project&lt;br /&gt;&lt;br /&gt;# remove the project&lt;br /&gt;rm -rf /var/svn/my-repository/my-project &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#client side&lt;br /&gt;&lt;br /&gt;# list the contents of my-project&lt;br /&gt;svn list --verbose http://my-site.com/svn/my-repository/my-project &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# *update 29-Oct-07*&lt;br /&gt;# it's possible to import, or remove the project from the client-side&lt;br /&gt;&lt;br /&gt;# add the new project&lt;br /&gt;svn import my-project http://my-site.com/svn/my-repository/my-project &lt;br /&gt;&lt;br /&gt;# remove the project&lt;br /&gt;svn delete http://my-site.com/svn/my-repository/my-project &lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Note: To use http on the client side, it's necessary to have Apache configured using SVN and DAV. Refer to HOWTO Apache2 with subversion SVN and DAV. http://urltea.com/1uqg</description>
      <pubDate>Tue, 23 Oct 2007 11:37:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4689</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Set common svn:externals easily</title>
      <link>http://snippets.dzone.com/posts/show/4273</link>
      <description>&lt;code&gt;&lt;br /&gt;#!/usr/bin/env ruby&lt;br /&gt;shared = 'shared' # Directorio protegido sobre el que jam&#225;s se ejecutara nada.&lt;br /&gt;# Lista de directorios con elementos externos:&lt;br /&gt;elementos_externos = { # 'directorio' =&gt; {'elemento_externo =&gt; 'URL del repositorio'}&lt;br /&gt;  'public/images' =&gt; {'_app' =&gt; 'svn://server/rails_app/public/images/_gw'},&lt;br /&gt;  'public/javascripts' =&gt; {'_app' =&gt; 'svn://server/paxx/public/gooworks/rails_app/public/javascripts/_gw'},&lt;br /&gt;  'public/stylesheets' =&gt; {'_app' =&gt; 'svn://server/rails_app/public/stylesheets/_gw'},&lt;br /&gt;  'vendor' =&gt; {'rails' =&gt; 'http://dev.rubyonrails.com/svn/rails/trunk'}&lt;br /&gt;# 'dir' =&gt; ['ext' =&gt; 'url', 'ext2' =&gt; 'url'] &lt;-- para varios externos en un mismo directorio&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ARGV[0].nil?&lt;br /&gt;  puts "Especifica el directorio en el que quieres trabajar: #{$0} &lt;directorio&gt;"&lt;br /&gt;  exit&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;max_dir_size = 0; max_ext_size = 0&lt;br /&gt;elementos_externos.each do |dir, extlist|&lt;br /&gt;  max_dir_size = dir.size if dir.size &gt; max_dir_size&lt;br /&gt;  extlist.each do |ext, url|&lt;br /&gt;    max_ext_size = ext.size if ext.size &gt; max_ext_size&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;script_dir = Dir.pwd&lt;br /&gt;tmp_file = "#{script_dir}/_svnext_temp_file"&lt;br /&gt;&lt;br /&gt;# Esto permite usar comodines, como '*'&lt;br /&gt;ARGV.each do |wd|&lt;br /&gt;  if FileTest.directory?(wd) &amp;&amp; wd.chomp('/') != 'gooworks'&lt;br /&gt;    puts "".ljust(80, '=')&lt;br /&gt;    puts "Trabajando en #{wd}:"&lt;br /&gt;    Dir.chdir(wd)&lt;br /&gt;    elementos_externos.sort.each do |dir, extlist|&lt;br /&gt;      file = File.open(tmp_file, 'w') if extlist.size &gt; 1&lt;br /&gt;      extlist.sort.each do |ext, url|&lt;br /&gt;        if file.nil?&lt;br /&gt;          out = %x[svn ps svn:externals '#{ext} #{url}' #{dir}]&lt;br /&gt;        else&lt;br /&gt;          file.puts "#{ext} #{url}"&lt;br /&gt;          out = 'Escribiendo archivo temporal...'&lt;br /&gt;        end&lt;br /&gt;        puts "Configurando #{ext.ljust(max_ext_size)}: #{out}"&lt;br /&gt;      end&lt;br /&gt;&lt;br /&gt;      unless file.nil?&lt;br /&gt;        file.close&lt;br /&gt;        # Ejecutamos Subversion para que lea los elementos del archivo que creamos:&lt;br /&gt;        out = %x[svn ps svn:externals -F #{tmp_file} #{dir}]&lt;br /&gt;        puts "Configurado (#{extlist.size} elementos): #{out}"&lt;br /&gt;        File.delete(tmp_file)&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;    Dir.chdir(script_dir)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 07 Jul 2007 00:50:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4273</guid>
      <author>ivanelterrible (Ivan V.)</author>
    </item>
    <item>
      <title>Opera Syncing using Svn</title>
      <link>http://snippets.dzone.com/posts/show/4219</link>
      <description>This batch file allows to run opera after checking out your web-based opera profile. When you terminate your opera session, the batch will commit the changes you made to your profile during the opera session.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; REM OperaSync.bat&lt;br /&gt; @echo off&lt;br /&gt; &lt;br /&gt; set PRG=Opera&lt;br /&gt; set TARGET=%APPDATA%/%PRG%/%PRG%/profile&lt;br /&gt; set EXEC=%PROGS%/%PRG%/%PRG%.exe&lt;br /&gt; set REPO=https://********.googlecode.com/svn/trunk/%PROG%Sync&lt;br /&gt; set USER=*************&lt;br /&gt; &lt;br /&gt; echo Checking out from %REPO% ...&lt;br /&gt; svn checkout %REPO% "%TARGET%" --username %USER%&lt;br /&gt; echo %PROG% running ...&lt;br /&gt; %EXEC%&lt;br /&gt; echo Commiting to %REPO% ...&lt;br /&gt; svn commit -m --force-log "%TARGET%"&lt;br /&gt; echo Done.&lt;br /&gt; &lt;br /&gt; @echo on&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here's the list of files that I update from a svn repo for my Opera profile&lt;br /&gt;&lt;code&gt;&lt;br /&gt;contacts.adr&lt;br /&gt;files.txt&lt;br /&gt;jscripts/&lt;br /&gt;jscripts/deliciousmp3.js&lt;br /&gt;notes.adr&lt;br /&gt;opcacrt6.dat&lt;br /&gt;opcert6.dat&lt;br /&gt;opera6.adr&lt;br /&gt;search.ini&lt;br /&gt;sessions/&lt;br /&gt;sessions/autosave.win&lt;br /&gt;sessions/autosave.win.bak&lt;br /&gt;speeddial.ini&lt;br /&gt;&lt;/code&gt;&lt;br /&gt; </description>
      <pubDate>Thu, 28 Jun 2007 18:47:19 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4219</guid>
      <author>griflet (guillaume riflet)</author>
    </item>
    <item>
      <title>Trac Subversion Repository scraper</title>
      <link>http://snippets.dzone.com/posts/show/3376</link>
      <description>Ruby script to pull code from a Trac repo browser.  Useful if you are behind a firewall/proxy and the server has no http access to the subversion repo. (I'm sure its not the prettiest/best/rubiest way to do it, but it worked for me)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/env ruby&lt;br /&gt;&lt;br /&gt;require 'rubygems'&lt;br /&gt;require 'hpricot'&lt;br /&gt;require 'open-uri'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#a Trac repo scraper. pass the url to scrape (the root of a repo)&lt;br /&gt;#  and optionally the local path to write to.  defaults to .&lt;br /&gt;&lt;br /&gt;class TracRepoScraper&lt;br /&gt;&lt;br /&gt;  def initialize(trac_url, local_path='.')&lt;br /&gt;    @trac_url = trac_url&lt;br /&gt;&lt;br /&gt;    trac_url =~ /(http:\/\/.*?)\//&lt;br /&gt;    @trac_server = $1&lt;br /&gt;    @local_path =  local_path&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def getallfiles(url,cur_localpath)&lt;br /&gt;    if cur_localpath != '.'&lt;br /&gt;      Dir.mkdir(cur_localpath)&lt;br /&gt;    end&lt;br /&gt;    doc = Hpricot(open(url).read)&lt;br /&gt;    doc.search("//tbody//tr//td//a[@class='file']").each do |file_anchor|&lt;br /&gt;      #get the file as curpath+/file_name&lt;br /&gt;&lt;br /&gt;      #following gives us absolute path (excluding domain)&lt;br /&gt;      actual_file_url = @trac_server + file_anchor['href']+'?format=raw'&lt;br /&gt;      #temp&lt;br /&gt;      puts "Saving #{actual_file_url} to #{cur_localpath}/#{file_anchor.inner_html}"&lt;br /&gt;      #read the file and write to a file in the correct directory&lt;br /&gt;      File.open(cur_localpath+"/"+file_anchor.inner_html, 'w') do |f|&lt;br /&gt;        remote_file = open(actual_file_url)&lt;br /&gt;        remote_file.each { |line|&lt;br /&gt;          f.puts(line)&lt;br /&gt;        }&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;    doc.search("//tbody//tr//td//a[@class='dir']").each do |dir_anchor|&lt;br /&gt;      #go into the directory&lt;br /&gt;      dir_url = @trac_server + dir_anchor['href']&lt;br /&gt;      puts "*** stepping into #{dir_url}"&lt;br /&gt;      #dir_anchor.inner_html is the name of the subdirectory (relative)&lt;br /&gt;      getallfiles(dir_url, cur_localpath+"/"+dir_anchor.inner_html)&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def start&lt;br /&gt;    getallfiles(@trac_url, @local_path)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#### main&lt;br /&gt;&lt;br /&gt;trac_url = ARGV[0]&lt;br /&gt;localpath = '.'&lt;br /&gt;if ARGV[1]&lt;br /&gt;  if !ARGV[1].strip.empty?&lt;br /&gt;    localpath = ARGV[1].strip&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;TracRepoScraper.new(trac_url, localpath).start&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 27 Jan 2007 02:25:10 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3376</guid>
      <author>deanh (Dean Holdren)</author>
    </item>
  </channel>
</rss>
