Discussion:
svnmucc and creating new files in existing directories
Sam Ruby
2017-06-05 14:08:03 UTC
Permalink
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?

- Sam Ruby
Daniel Shahaf
2017-06-05 18:10:47 UTC
Permalink
Post by Sam Ruby
When I moved whimsy from Ubuntu 14.04 (svn 1.8.8) to Ubuntu 16.04 (svn
$ 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.
Sam Ruby
2017-06-05 18:24:07 UTC
Permalink
Post by Daniel Shahaf
Post by Sam Ruby
When I moved whimsy from Ubuntu 14.04 (svn 1.8.8) to Ubuntu 16.04 (svn
$ 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)

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

- Sam Ruby
Daniel Shahaf
2017-06-05 21:14:09 UTC
Permalink
Post by Sam Ruby
Post by Daniel Shahaf
Post by Sam Ruby
When I moved whimsy from Ubuntu 14.04 (svn 1.8.8) to Ubuntu 16.04 (svn
$ 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
# 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.
Post by Sam Ruby
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.

Daniel

Loading...