subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Shahaf" <...@daniel.shahaf.name>
Subject Re: Adding a shorthand URL syntax to cwd's URL (was: Re: Automatically supply the origin URL in svn merge)
Date Sat, 28 Mar 2020 05:47:32 GMT
Anton Shepelev wrote on Sat, 28 Mar 2020 00:41 +00:00:
> Daniel Shahaf:
> > Tilde is also special to some shells, at least in the sh/csh
> > «~username» syntax and in zsh's «foo~bar» syntax (also part of
> > EXTENDED_GLOB);
> 
> That is why I proposed a double `~' -- not perfect, of course, but
> I think none of the major shells will expand it. Of course, if I
> were designing it from scratch I should try to pick a single ASCII
> character that none of the common shells treat as special. I am not
> even sure that such a character exists, does it?
> 

Period, comma, colon, underscore, plus, opening curly brace, forward
slash, closing square bracket(?), and multi-character sequences of
these.

> > An --option sounds a little too specialized to me.  Also, it's a
> > form of action at a distance (the positional arguments and the
> > --option's presence would be coupled), whereas the ^/ syntax is
> > self-contained.
> 
> Also true, but depends on one's viewpoint. I viewed
> `svn cp --remote' as a command acting upon the remote repository
> and `svn cp' as a command acting upon the working directory. In
> other words -- as a remote and a local command: two different
> commands with different interpretation of their arguments. Although
> this view is factally wrong,

Yeah, Subversion's convention is the other way around: arguments are
interpreted as URLs iff they look like URLs.  This is true throughout
the CLI as well as in the API (e.g., svn_client_copy_source_t::path,
despite its name).

> it helps me understand SVN better, because local operations and
> sever-side operations are in my opinion very different, even though
> they fall into the same categories of copy, delete, move, &c. They are
> like different implementations of the same interface, but I divagate.

They _are_ different implementations of the same interface…

But anyway, if you want a command that takes local filenames and copies
remote files, couldn't you just write one?  Using the URL flavours of
«svn cp» is racy (they won't throw out-of-date errors if something
changed between BASE and HEAD), but there are two sound alternatives:

1. This:

    #!/bin/sh
    svn cp -- "$1" "$2"
    svn ci -- "$2"
    svn up -r0 -- "$2"

2. «svnmucc -r».

Cheers,

Daniel

Mime
View raw message