[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

the @ syntax (was: svn commit: rev 1643 ...)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-04-06 00:31:45 CEST

On Fri, Apr 05, 2002 at 03:33:43PM -0600, cmpilato@collab.net wrote:
> "Bill Tutt" <rassilon@lyra.org> writes:
> > That's correct. See the very bottom of:
> >
> > http://www.perforce.com/perforce/doc.011/manuals/cmdref/o.fspecs.html
> We could just keep the single '@' seperator, and if you have a file
> with '@' in the name itself, allow for "@@" escaping.

This will make shell scripting more difficult. You'd need to make sure that
all files that you process have no '@' characters in them.

I *really* like the @ syntax, but worry some about making it a bit tougher
to script.

Oh: and just testing for @DIGITS is insufficient. @head should work. Also,
@2002-04-05-14:19 should be able to work. Or "foo@april 4, 2002".

Here is an idea: what if we say that a trailing @ means "no revision
specified". Essentially, the syntax would be:

    file '@' revision

Where revision can be empty, a number, a few keywords, or a date. Since we
only look at the *last* '@' symbol, then a shell script can simply do:

for f in $*; do
  svn add $f@

That trailing @ ensures that we don't look at a @ symbol in $f and attempt
to process it.

[ and generally, a dumb shell script that forgets to add @ is still going to
  work for most cases; at some point, a file with @ will be passed into the
  script and it will break, but oh well. ]

> Note the following paths at revision 123:
> foo -> foo@123
> foo@bar -> foo@@bar@123
> foo@123 -> foo@@123@123
> Of course, that means always un-escaping input paths, and the doom of
> using your shell's path completion (you'll have to insert extra '@'s),
> but...

The unescaping is no big deal. Recall that we already need to process the
input paths: the cmdline client needs to ensure that all paths are in UTF-8
before passing them into the Subversion libraries. Normally, I think we
would presume that the paths are in the current locale when they get passed
via argv[].


Greg Stein, http://www.lyra.org/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 6 00:27:42 2002

This is an archived mail posted to the Subversion Dev mailing list.