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

Re: [PATCH]: Was [PROPOSAL] Takeover Take 2

From: Paul Burba <paulb_at_softlanding.com>
Date: 2006-06-22 15:31:50 CEST

Hi All,

I'm reposting this patch in the hope someone might be able to take a look.
 It is a fairly complex change compared to what I've done before (at least
outside of the OS400/EBCDIC port) so I'd like to have another set of eyes
look at it.

Thanks,

Paul B.

========================================

Paul Burba <paulb@softlanding.com> wrote on 06/15/2006 02:01:30 PM:

Hi All,

After a delay working on some other things I had a chance to rework this
patch based on your various suggestions. While there are a lot of little
tweaks (e.g. improved comments, new Python tests) the following are the
major changes from the previous patch:

----------------------------------------

1) "Takeover" is no more, the term that is. This patch is about
tolerating obstructions to added items, so to avoid confusion I've removed

all reference to "takeover" in the patch. This doesn't actually have much

of a user-visible impact, just that the notification of obstructions is no

longer 'T'akeover but rather 'E' for 'already Exists' (Thanks Philip).

----------------------------------------

2) Obstruction tolerance is now available using --force for update and
switch as well as checkout. The --help messages for sw, up, and co
describe the new behavior.

----------------------------------------

3) Obstructing versioned directory obstructions are no longer allowed and
always cause an error.

----------------------------------------

4) svn_client_cleanup() is no longer used to "fix" the entries file so
that 'E'xisting WC files with no actual modifications have their text-time

field set the file's last modified time. Instead I revved
svn_wc_text_modified_p() so it has the option to use the base revision in
tmp when checking for mods. Now we can not only check if an obstructing
file differs from a file about to be added, but svn_wc_text_modified_p()
cleans up the entries file:

  From svn_wc__text_modified_internal_p():

  /* It is quite legitimate for modifications to the working copy to
     produce a timestamp variation with no text variation. If it turns out
     that there are no differences then we might be able to "repair" the
     text-time in the entries file and so avoid the expensive file
contents
     comparison in the future. */
  if (! *modified_p && svn_wc_adm_locked(adm_access))
    {
      svn_wc_entry_t tmp;
      SVN_ERR(svn_io_file_affected_time(&tmp.text_time, filename, pool));
      SVN_ERR(svn_wc__entry_modify(adm_access,
                                   svn_path_basename(filename, pool),
                                   &tmp, SVN_WC__ENTRY_MODIFY_TEXT_TIME,
TRUE,
                                   pool));
    }

Sidebar: I noticed that this "repair" behavior is not described in the doc

string for svn_wc_text_modified_p(), should it be?

----------------------------------------

5) Eliminated references to the command line client in the svn_wc_* APIs
and code.

----------------------------------------

Please take a look if you have some time. Any and all feedback
appreciated, thanks,

Paul B.

[[[
Support --force option with svn checkout, update, and switch.

With the force option, co, sw, and up now tolerate unversioned
obstructing paths when adding new paths of the same type, rather than
generating a SVN_ERR_WC_OBSTRUCTED_UPDATE error.

If the obstructing path is the same type (file or directory) as the
corresponding path in the repository it will be left 'as-is' in the
working copy. For directories this simply means the obstruction is
tolerated. For files, any content differences between the obstruction
and the repository are treated like a local modification to the
working copy.

This patch is an expansion of one originally posted by Jonathan Gilbert
<o2w9gs702@sneakemail.com> against the 1.2.0 tag. See the various
"Takeover" threads on the dev mailing list.

* build.conf
  (test-scripts): Add checkout_tests.py.

* subversion/include/svn_client.h
  (svn_client_checkout3, svn_client_update3,
  svn_client_switch2): New.
  (svn_client_checkout2, svn_client_update2,
  svn_client_switch): Deprecate.

* subversion/include/svn_wc.h
  (svn_wc_notify_action_t): New 'Exists' action.
  (svn_wc_get_update_editor3, svn_wc_text_modified_p2,
  svn_wc_get_switch_editor3): New.
  (svn_wc_get_update_editor2, svn_wc_text_modified_p,
  svn_wc_get_switch_editor2): Deprecate.

* subversion/libsvn_client/checkout.c
  (svn_client__checkout_internal): New argument. Update calls to
  svn_client__update_internal.
  (svn_client_checkout3): New.
  (svn_client_checkout): Reimplement as wrapper around
  svn_client_checkout3.
  (svn_client_checkout): Update call to svn_client__checkout_internal.

* subversion/libsvn_client/client.h
  (svn_client__update_internal, svn_client__checkout_internal,
  svn_client__switch_internal): New bool argument to identify updates,
  checkouts, and switches, respectively, made with --force option.

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy): Update call to svn_client__checkout_internal.
 
* subversion/libsvn_client/externals.c
  (switch_external): Update calls to svn_client__checkout_internal,
  svn_client__update_internal, and svn_client__switch_internal.
  (handle_external_item_change): Update call to
  svn_client__checkout_internal.

* subversion/libsvn_client/switch.c
  (svn_client__switch_internal): New argument. Replace call to
  svn_wc_get_switch_editor2 with svn_wc_get_switch_editor3.
  (svn_client_switch2): New.
  (svn_client_switch): Update call to svn_client__switch_internal.

* subversion/libsvn_client/update.c
  (svn_client__update_internal): New argument. Replace call to
  svn_wc_get_update_editor2 with svn_wc_get_update_editor3.
  (svn_client_update3): New.
  (svn_client_update2): Reimplement as wrapper around
  svn_client_update3.
  (svn_client_update): Update call to svn_client__update_internal.

* subversion/libsvn_wc/adm_ops.c
  (revert_admin_things): Update call to
  svn_wc__text_modified_internal_p.

* subversion/libsvn_client/commit_util.c (harvest_committables):
* subversion/libsvn_wc/diff.c (file_diff, close_file):
* subversion/libsvn_wc/log.c (svn_wc_cleanup2):
* subversion/libsvn_wc/status.c (assemble_status):
  Replace calls to svn_wc_text_modified_p with svn_wc_text_modified_p2.

* subversion/libsvn_wc/props.c
  (svn_wc_prop_set2): Update comment.

* subversion/libsvn_wc/questions.c
  (svn_wc__text_modified_internal_p): New arg. Update call to
  svn_wc__text_base_path.
  (svn_wc_text_modified_p2): New. Update comment.
  (svn_wc_text_modified_p): Reimplement as wrapper around
  svn_wc_text_modified_p2

* subversion/libsvn_wc/update_editor.c
  (struct edit_baton): New member allow_obstructions.
  (struct file_baton): New member existed.
  (make_file_baton): Initialize new file_baton member.
  (add_directory): Allow obstructing directories if edit baton
  permits them. Support notification for adding directories which
  already 'E'xist.
  (add_or_open_file): Allow obstructing files if edit baton
  permits them.
  (change_file_prop): Cache the last-changed-date propval for
  obstructing files.
  (merge_file): New argument to identify when obstructions are
  allowed. Handle the various obstruction scenarios.
  (close_file): Update call to merge_file. Support notification for
  adding files which already 'E'xist.
  (make_editor): New argument to identify when obstructions are
  allowed. Initialize new edit baton member.
  (svn_wc_get_update_editor3) New.
  (svn_wc_get_update_editor, svn_wc_get_update_editor2): Reimplement
  as wrappers around svn_wc_get_update_editor3.
  (svn_wc_get_switch_editor3): New.
  (svn_wc_get_switch_editor, svn_wc_get_switch_editor2): Reimplement
  as wrappers around svn_wc_get_switch_editor3.

* subversion/libsvn_wc/wc.h
  (svn_wc__text_modified_internal_p): New arg.

* subversion/svn/checkout-cmd.c
  (svn_cl__checkout): Replace call to svn_wc_get_update_editor2 with
  svn_wc_get_update_editor3.

* subversion/svn/main.c
  (svn_cl__cmd_table): Enable --force option with svn co, up, and sw.
  Add new help text for each.

* subversion/svn/notify.c
  (notify): Handle new 'Existed' action.

* subversion/svn/switch-cmd.c
  (svn_cl__switch): Replace call to svn_client_switch with
  svn_client_switch2.

* subversion/svn/update-cmd.c
  (svn_cl__update): Replace call to svn_client_update2 with
  svn_client_update3.

* subversion/tests/cmdline/checkout_tests.py: New.

* subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
  Update to reflect new svn switch help text.

* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_checkout): Support optional arguments. Don't delete
  WC target during forced checkouts.

* subversion/tests/cmdline/svntest/main.py
  (run_and_verify_switch): Support optional arguments and regular
  expression error checking.

* subversion/tests/cmdline/svntest/tree.py
  (build_tree_from_checkout): Enable parsing of 'E' notification.

* subversion/tests/cmdline/switch_tests.py
  (forced_switch, forced_switch_failures): New test definitions.
  (test_list): Run new tests.

* subversion/tests/cmdline/update_tests.py
  (forced_update, forced_update_failures): New test definitions.
  (test_list): Run new tests.
]]]

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

Received on Thu Jun 22 15:35:05 2006

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

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