# SVN command not executing correctly through ruby script

**URL:** <https://www.ruby-forum.com/t/svn-command-not-executing-correctly-through-ruby-script/107668>\
**Category:** Ruby\
**Created:** [June 25, 2007, 4:34am UTC](https://www.ruby-forum.com/t/svn-command-not-executing-correctly-through-ruby-script/107668 "2007-06-25T04:34:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c4cdca/32.png) [@Kristen](https://www.ruby-forum.com/u/Kristen)\
**Post date:** [June 25, 2007, 4:34am UTC](https://www.ruby-forum.com/t/svn-command-not-executing-correctly-through-ruby-script/107668/1 "2007-06-25T04:34:11Z")

</div>

Hello,

Im trying to get some code working from the book “Everyday Scripting  
with Ruby for Teams, Testers, and You” by Brian M… The code  
resides on page 85.

Basically, whats happening is that Im loading this method into irb using  
load ‘churn.rb’:

def svn\_log(subsystem, start\_date)  
timespan = “-revision ‘HEAD:{#{start\_date}}’”  
root = “svn://rubyforge.org//var/svn/churn-demo”

`svn log #{timespan} #{root}/#{subsystem}`  
end

after its loaded, I execute the command:

svn\_log(‘persistence’, ‘2005-06-30’)

which should return some SVN(subversion) data. I have subversion  
installed.

But instead Im getting a syntax error, which doesnt make sense since i  
have spelled everything correctly (triple checked).

Here is the error:

irb(main):002:0\> svn\_log(‘persistence’, ‘2005-06-30’)  
subversion/clients/cmdline/main.c:939: (apr\_err=205000)  
svn: Syntax error in revision argument ‘evision’  
=\> “”

After seeing this, Im wondering if the online source even exists. Could  
someone please check this for me since Im not the sharpest tool in the  
shed when it comes to Subversion just yet.

Also, any advice on how to solve this is greatly appreciated.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Kristen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c4cdca/32.png) [@Kristen](https://www.ruby-forum.com/u/Kristen)\
**Post date:** [June 25, 2007, 6:08am UTC](https://www.ruby-forum.com/t/svn-command-not-executing-correctly-through-ruby-script/107668/2 "2007-06-25T06:08:39Z")

</div>

I haven’t a clue bout any of this stuff. But your root string looks  
funky for a url. Double slash after .org?

---

<div class="post-metadata">

**Author:** ![Kristen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c4cdca/32.png) [@Kristen](https://www.ruby-forum.com/u/Kristen)\
**Post date:** [June 25, 2007, 6:19am UTC](https://www.ruby-forum.com/t/svn-command-not-executing-correctly-through-ruby-script/107668/3 "2007-06-25T06:19:43Z")

</div>

> timespan = “-revision ‘HEAD:{#{start\_date}}’”

According to the svn help output, the flag for revision should either be  
a short -r or a long --revision

-Doug

---

<div class="post-metadata">

**Author:** ![Kristen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c4cdca/32.png) [@Kristen](https://www.ruby-forum.com/u/Kristen)\
**Post date:** [June 25, 2007, 7:35am UTC](https://www.ruby-forum.com/t/svn-command-not-executing-correctly-through-ruby-script/107668/4 "2007-06-25T07:35:39Z")

</div>

> a short -r or a long --revision

That was it. Thanks you very much!
