[tahoe-dev] [tahoe-lafs] #705: "tahoe mv" unlinks the target even when it is a directory

tahoe-lafs trac at allmydata.org
Thu Jul 16 05:36:35 PDT 2009


#705: "tahoe mv" unlinks the target even when it is a directory
-------------------------------+--------------------------------------------
 Reporter:  zooko              |           Owner:  kevan
     Type:  defect             |          Status:  new  
 Priority:  critical           |       Milestone:  1.5.0
Component:  code-frontend-cli  |         Version:  1.4.1
 Keywords:  reliability        |   Launchpad_bug:       
-------------------------------+--------------------------------------------

Comment(by zooko):

 You're right about {{{POST ?t=rename}}} not offering this functionality --
 sorry I overlooked that.  In the future, it might be good to extend
 {{{POST ?t=rename}}} to do that, but I agree with you that doing so would
 take longer and be more prone to error than other ways to solve this
 ticket right now.  If you wanted to extend {{{POST ?t=rename}}}, you'd
 start [source:src/allmydata/web/directory.py at 20090715025814-92b7f-
 d4af644430e5daef6d6ad57cc550c8faceaeb2cf#L327 here in directory.py], and
 change it to look up the target node by name before calling
 {{{move_child_to}}}.

 Your proposal for how to extend {{{PUT}}} to have {{{replace=only_files}}}
 sounds right to me.  You should push this extended semantics of
 {{{replace}}} all the way down into
 [source:src/allmydata/dirnode.py at 20090713001320-92b7f-
 fe89f2baaab25c8eb3eb96c146177eb42108aeee#L73 the Adder class].  That class
 currently takes a constructor argument {{{overwrite}}} which is a boolean.
 You could either change it to a multi-option argument (i.e.
 {{{overwrite}}} can be one of "yes", "no", "only_files"), or add a second
 argument named something like {{{preserve_directories}}} which is a
 boolean and add a precondition assertion that {{{not ((not overwrite) and
 preserve_directories)}}} (i.e. it is a mistake if someone passed
 {{{overwrite=False}}} and {{{preserve_directories=True}}} to the
 constructor of {{{Adder}}}.)

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/705#comment:20>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list