svnmucc and creating new files in existing directories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svnmucc and creating new files in existing directories

Sam Ruby
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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: svnmucc and creating new files in existing directories

Daniel Shahaf-2
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: svnmucc and creating new files in existing directories

Sam Ruby
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)

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

- Sam Ruby
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: svnmucc and creating new files in existing directories

Daniel Shahaf-2
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.

Daniel
Loading...