intertwingly

It’s just data

Peg svn revisions


Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato: You need only append an at sign to the end of the path, such as news@11@.

But only for versions of svn >= 1.5.  Very annoying.  Especially if you have a script that works for everything you throw at it, until it comes across a file with name containing an ‘@’.  So you dutifully add the ‘@’ as others have done, find that the code passes all of your tests and then fails on a co-worker’s machine who is running a different version of svn.

Code to determine what to append to a given name for use in svn commands (including, BTW, proplist, propget, propset,...):

def svn_at name
  if (`svn --version --quiet`.chomp.split('.') <=> %w(1 5)) < 1
    ''
  elsif name.include? '@'
    '@'
  else
    ''
  end
end

My two cents: information on the basic syntax of working copy (WC) paths as used by the command line should not be buried in a chapter named Advanced Topics in a section entitled Peg and Operative Revisions.