[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-07-11 21:52:21 CEST

Julian Foad <julianfoad@btopenworld.com> wrote on 06/29/2006 08:38:50 PM:

> Paul Burba wrote:
> > Julian Foad <julianfoad@btopenworld.com> wrote on 06/27/2006 07:51:21
PM:
> [...]
> >>We should seriously consider adding a more specific command-line
> option name
> >>too. It's pure chance that the three commands you wanted to add
> >>this behaviour
> >>to didn't already have "--force" options for some other purpose.
> >
> > One man's pure chance is another's serendipity. Seriously, I have no
> > strong objections to a new option, but wouldn't this be a problem with

> > *any* new behavior associated with --force? Is it simply the
ill-defined
> > nature of --force in general that concerns you?
> > http://svn.haxx.se/dev/archive-2006-05/0143.shtml
>
> Yes, I advocate creating a new, well-defined command-line option foreach
new
> behaviour, not just this one.

So really, you'd prefer that --force never be added to any subcommand
which doesn't already support it right? On a scale of 1 [don't care] to
10 [vehemently opposed, will do all in your power to thwart :-)] how
strongly do you feel about this patch using --force? I have no great
argument in favor of --force other than it seems appropriate for what I'm
doing here and is available. Long story short, if you really feel
strongly about it I'll add a new option. --allow-obstructions maybe?
 
> Have a good trip to the woods and don't do computer stuff unless
> you're really
> stuck for anything else!

It didn't rain much, so I didn't use my laptop much, except to confirm
that it wouldn't rain :-)

> Teach yourself a new song or a poem, or try to
> whittle yourself a wooden spoon using a knife...

No luck with the spoon, song, or poem, but I did learn 2 new things.
First, cycling up Crawford and Pinkham notches makes one think fondly of
internal combustion. Second, when deep in the woods, even small bears who
immediately run *away* from you, are still quite scary when they burst
unexpectedly from the underbrush.

Julian Foad <julianfoad@btopenworld.com> wrote on 06/27/2006 07:51:21 PM:

> Right, that's all for tonight; I'll try to do some more but it probably
won't
> be tomorrow. Feel free to send an update in the meantime. Thanks
> for listening...

Here is a new patch, mostly it's just catching up with the latest activity
on trunk (r20569). There is a small tweak to the checkout_test.py in test
#8 import_and_checkout that fixes a failure when running the tests via
ra_svn.

Let me know if you had any other suggestions or any outstanding comments
on my previous update http://svn.haxx.se/dev/archive-2006-06/0951.shtml.

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_checkout2, svn_client_checkout): Update calls 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_unver_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 to select comparison
  against normal text base or temporary text base.

* 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 Tue Jul 11 21:53:27 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.