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

Re: [PATCH] new feature: takeover

From: Jonathan Gilbert <o2w9gs702_at_sneakemail.com>
Date: 2005-07-07 04:31:30 CEST

At 04:35 PM 06/07/2005 -0400, I wrote:
[snip]
>I'm also thinking about ways to efficiently check the checksums of existing
>files against the repository.

After some discussion on the IRC channel and investigation into the code
that drives the servers, it seems that this actually is not something that
could be hacked on, albeit inefficiently without a specialized server
command, but something that is impossible without adding a new command to
the libsvn_ra interface.

I have cleaned up my patch, and it no longer damages the public API, but it
still does not avoid downloading files that already exist. I will begin
poking around at the RA transport providers, and maybe some time in the
next little while I'll come up with a patch that makes the 'svn takeover'
command effective as a means to avoid large amounts of data transfer from
the server.

Please see the attached diff. Again, I must apologize that it is against
the latest revision in the "1.2.0" tag, and also that I haven't properly
updated the autodocumentation comments. Also note that my e-mail program
probably converted the patch to CRLF line endings. I don't know if this
makes a difference to 'patch', but if it does, you'll need to convert it
back to the 'LF' endings that 'svn diff' outputs.

Someone mentioned that I neglected to provide a detailed changelog of the
current set of changes, so here it is:

[[[
New Feature: 'svn takeover' (command-line client)

   * subversion/include/svn_client.h:
     - Added prototype for new function 'svn_client_checkout3'.
   * subversion/include/svn_wc.h:
     - Added new notification type 'svn_wc_notify_update_takeover' to
       the end of the enumeration 'svn_wc_notify_action_t'.
     - Added prototype for new function 'svn_wc_get_update_editor3'.
   * subversion/clients/cmdline/notify.c:
     - Added 'case' statement to handle the new
       'svn_wc_notify_update_takeover' command. Outputs a 'T' to the
       left of the specified filename.
   * subversion/libsvn_wc/update_editor.c:
     - Added new boolean field 'taking_over' to the 'struct edit_baton'
       data type.
     - Added new boolean field 'taken_over' to the 'struct file_baton'
       data type.
     - Added initialization for 'struct file_baton's new 'taken_over'
       field to function 'make_file_baton'.
     - Added code to handle takeover case in 'add_or_open_file'; if
       file exists when taking over, the 'file_baton's 'taken_over'
       member is set.
     - Added code to handle takeover case in 'change_file_prop'; if
       file is taken over, the commit date is stored for later use as
       the 'text-time' in entries.
     - To the 'install_file' function:
       + Added parameter indicating whether the file was taken over.
       + Avoided checking for modifications if the file was taken
         over.
       + Added code to create an admin log entry to set the 'entries'
         file 'text-time' field for taken over files.
     - Added the 'file_baton' structure's 'taken_over' member as a
       parameter to 'close_file's call to 'install_file'.
     - Added code to emit the new 'svn_wc_notify_update_takeover'
       notify type for taken over files. The status code for taken-over
       files is 'T'.
     - Added 'taking_over' parameter to 'make_editor' indicating
       whether files should be taken over if they already exist. Added
       code to assign this boolean value into the new 'taking_over'
       field of the data type 'struct edit_baton'.
     - New function: 'svn_wc_get_update_editor3': identical to
       'svn_wc_get_update_editor2' with a 'taking_over' parameter.
     - Added 'FALSE' to 'svn_wc_get_update_editor2's function call to
       'make_editor' for the 'taking_over' parameter.
     - Added 'FALSE' to 'svn_wc_get_switch_editor2's function call to
       'make_editor' for the 'taking_over' parameter.
     - Added 'FALSE' to 'svn_wc_add_repos_file's function call to
       'install_file' for the 'taken_over' parameter.
   * subversion/libsvn_client/externals.c: Added 'FALSE' to four
     function calls to 'svn_client__checkout_internal' and one call to
     'svn_client__update_internal' in 'handle_external_item_change' for
     new 'taking_over' parameter to these internal functions.
   * subversion/libsvn_client/client.h: Added boolean 'taking_over'
     parameter to 'svn_client__update_internal' and to
     'svn_client__checkout_internal'.
   * subversion/libsvn_client/checkout.c:
     - To the 'svn_client__checkout_internal' function:
       + Added boolean 'taking_over' parameter indicating whether the
         checkout operation is actually a takeover operation.
       + Added sanity check to prevent takeover operations from being
         done against nonexistent repository paths.
       + Added 'FALSE' parameter to function call to
         'svn_client__update_internal' for the case of nonexistent
         repository paths for 'taking_over' parameter.
       + Passed 'taking_over' parameter to two function calls to
         'svn_client__update_internal' for normal checkout cases.
     - New function: 'svn_client_checkout3': identical to
       'svn_client_checkout2' with a 'taking_over' parameter.
     - Added 'FALSE' to 'svn_client_checkout2's function call to
       'svn_client__checkout_internal' for the 'taking_over' parameter.
     - Added 'FALSE' to 'svn_client_checkout's function call to
       'svn_client__checkout_internal' for the 'taking_over' parameter.
   * subversion/libsvn_client/copy.c:
     - Added 'FALSE' to 'repos_to_wc_copy's function call to
       'svn_client__checkout_internal' for the 'taking_over' parameter.
   * subversion/libsvn_client/update.c:
     - Added boolean 'taking_over' parameter to
       'svn_client__update_internal' function indicating whether the
       update operation is part of a takeover operation.
     - Changed 'svn_client__update_internal's call to the
       'svn_wc_get_update_editor2' to a call to the new function
       'svn_wc_get_update_editor3', passing 'taking_over' in for the
       corresponding additional parameter.
     - Added 'FALSE' to 'svn_client_update2's function call to
       'svn_client__update_internal' for the 'taking_over' parameter.
     - Added 'FALSE' to 'svn_client_update's function call to
       'svn_client__update_internal' for the 'taking_over' parameter.
   * subversion/clients/cmdline/checkout-cmd.c:
     - New (static) function: 'checkout_takeover_impl'. Moved code from
       'svn_cl__checkout' here. Has same parameters as
       'svn_cl__checkout', plus boolean 'taking_over'.
     - New function: 'svn_cl__takeover': Calls 'checkout_takeover_impl'
       with 'TRUE' for the 'taking_over' parameter.
     - Modified 'svn_cl__checkout' to call 'checkout_takeover_impl'
       with' FALSE' for the 'taking_over' parameter.
   * subversion/clients/cmdline/cl.h:
     - Added prototype for the new function 'svn_cl__takeover'.
   * subversion/clients/cmdline/main.c:
     - Added initializer block for new command-line command
       'svn_takeover'; linked to the new 'svn_cl__takeover' command.
]]]

Dunno what good this'll do, though.. Since at this point the patch is only
a convenience thing and not yet a bandwidth saver, I doubt its ability to
make it past your scrutiny. :-) Well, there it is, anyway.

Jonathan Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Jul 7 04:30:51 2005

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