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

Re: svnmucc and creating new files in existing directories

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 05 Jun 2017 21:14:09 +0000

Sam Ruby wrote on Mon, 05 Jun 2017 14:24 -0400:
> On 06/05/2017 02:10 PM, Daniel Shahaf wrote:
> > Sam Ruby wrote on Mon, 05 Jun 2017 10:08 -0400:
> >> When I moved whimsy from Ubuntu 14.04 (svn 1.8.8) to Ubuntu 16.04 (svn
> >> 1.9.3), svnmucc commands started failing for me:
> >>
> >> $ svnmucc --revision 0 --message 'test data, please ignore' -- put -
> >> https://svn.apache.org/repos/private/financials/Bills/paid/test < test
> >> svnmucc: E160016: Can't commit to
> >> 'https://svn.apache.org/repos/private/financials/Bills/paid' because it
> >> is not a directory
> >>
> >> I can continue to replace svnmucc with svn checkout --depth empty; svn
> >> add, svn commit sequences; but I was wondering if I'm using svnmucc
> >> incorrectly?
> >
> > I assume it works if you leave the --revision out? The directory in
> > question doesn't exist in r0, so I wouldn't expect the command to work
> > as written.
> OK, that worked. Thanks!
> FWIW, I'm pretty sure that was cargo-culted from a script you had
> written (the mailing list subscription tool, to be specific), and the
> comment that line had was as follows:
> # add file to svn (--revision 0 means it won't overwrite an existing file)

I can't find that line in my working copy or in my commits list archives.

> Which leads to a question: what will svnmucc do if the file already exists?

Overwrite it. (Hopefully, someone will notice that the commit mail says
'M' rather than 'A' in the changed-paths list.)

The way it's supposed to work is, to modify a file, you get its contents
as of a known revision number, modify it, and then pass the revision
number back via the --revision argument; there is an example of this in
trunk/tlpreq/scripts/website in the helper function _append_to_URL().

Now, the same holds for creating a file: if you know that the file
doesn't exist in r42, then passing --revision=42 will cause the commit
to error out if it would modify (as opposed to create) the file. (That's
exactly analogous to out of date working copies.) This is what you
can have whimsy use.

As to --revision=0, apparently 1.8 interprets that as "Create a new
file", while 1.9 just errors out since the containing directory didn't
exist at r0. I'm not sure how to classify this delta: whether it's a
intentional change / bugfix / regression.

The --revision=0 usage was probably inspired by the 'svn up -r0' syntax,
however, that syntax works identically in 1.8/1.9/1.10.

Received on 2017-06-05 23:14:15 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.