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

Re: [PATCH] Was: Extending new update --force switch to handle local additions

From: Paul Burba <paulb_at_softlanding.com>
Date: 2006-11-08 22:10:48 CET

rooneg@gmail.com wrote on 10/25/2006 04:09:46 PM:

> On 10/25/06, Paul Burba <paulb@softlanding.com> wrote:
> > Hi All,
> >
> > This patch has been kicking around for a while so I'm reposting it.
> >
> > Even if no one has time to give it a detailed look, please let me know
if
> > you have any concerns with the core purpose of the patch - see the
log.
>
> You're leaking an error here:
>
> + /* db->path may be scheduled for addition without history.
> + In that case db->edit_baton->adm_access already has it locked.
*/
> + if (err && err->apr_err == SVN_ERR_WC_LOCKED)
> + {
> + err = svn_wc_adm_retrieve(&adm_access,
> + db->edit_baton->adm_access,
> + db->path, adm_access_pool);
> + }
>
> Need a svn_error_clear(err); before you overwrite it.
>
> There are other similar places in the rest of the patch.

Fixed this in prep_directory() and add_directory(), but I didn't see it
elsewhere...I take it you saw it at least 3 times?
 
> + if (entry && entry->copied)
> + {
> + return svn_error_createf(SVN_ERR_WC_OBSTRUCTED_UPDATE,
> + NULL,
> + _("Failed to add file '%s': a
"
> + "file of the same name is "
> + "already scheduled for
addition "
> + "with history"),
> + svn_path_local_style(fb->path,
> + pool));
> + }
>
> Indent is off by one for the { and } in that part.

Fixed.

> The patch generally seems ok to me, and the goal seems fine, although
> I haven't tested it, so I can't vouch for it actually working ;-)

I've hammered on this quite a bit, so I feel pretty good about it (famous
last words...) Also, the patch has three new tests, one each in
checkout_tests.py, switch_tests.py, and update_tests.py. These new tests
are quite thorough and in combination with the recent new tests for
sw/up/co --force, they work almost all of the new execution paths in the
patch. I've run the complete test suite, including these new tests and
everything passes.

Assuming no other objections arise I'll commit this sometime this week.

Thanks for taking a look Garrett,

Paul B.

[[[
Enable up/sw/co to tolerate obstructions scheduled for addition without
history.

It's no longer an error when an update, switch, or checkout attempts to
add a path that is already scheduled for addition *without* history in
the WC.

In the case of dirs, the directory is tolerated and reported as
'E'xisting.

For files, if the obstruction is identical textually to the addition
from the repos it is reported as 'E'xisting, if it differs it's treated
as a conflict.

Property merges for both files and dirs are reported normally,
i.e. ' ', 'C', 'G'.

Obstructions scheduled for addition *with* history still result in
an error.

* subversion/libsvn_wc/update_editor.c
  (dir_baton): New members existed and add_existed.
  (make_dir_baton): Initialize new dir_baton members.
  (file_baton): New member add_existed.
  (make_file_baton): Initialize new file_baton member.
  (prep_directory): Retrieve *svn_wc_adm_access_t if attempt to open it
  fails due to locked WC.
  (add_directory): Revamp tests of valid obstructions to add coming from
  repos to allow obstructions scheduled for addition without history.
  If dir is scheduled for addition without history, change the schedule in
  its parent and its own "this dir" entry to normal. Also change the
  "this dir" rev from 0 to the target revision. And lastly, use the
  'E'xists notification for obstructing adds without history.
  (add_or_open_file): Revamp tests of valid obstructions to add coming
  from repos to allow obstructions scheduled for addition without
  history. Set new file_baton member to true if appropriate.
  (merge_file): New argument 'add_existed'. If file is scheduled for
  addition without history, change its entry schedule to normal and create
  an empty text-base for it. Update the "matrix" and change it's
  implementation so obstructions scheduled for addition w/o history are
  merged.
  (close_file): Pass new file_baton member to merge_file() so it knows
  when obstruction is added w/o history. Report the file as 'E'xisting
  if the merge didn't conflict.

* subversion/svn/notify.c
  (notify): Expand svn_wc_notify_exists case to handle notification for
  obstructions scheduled for addition without history in addition to
  unvserioned obstructions.

* subversion/tests/cmdline/checkout_tests.py
  (forced_checkout_with_versioned_obstruction): Tweak expected error
  message to reflect changes in add_or_open_file.
  (co_with_obstructing_local_adds): New test.
  (test_list): Run new test.

* subversion/tests/cmdline/switch_tests.py
  (forced_switch_failures): Tweak expected error to reflect new error
  message.
  (switch_with_obstructing_local_adds): New test.
  (test_list): Run new test.

* subversion/tests/cmdline/update_tests.py
  (update_receive_illegal_name, forced_update_failures): Tweak expected
  errors to reflect new error messages.
  (update_with_obstructing_additions): New test.
  (test_list): Run new test.
]]]

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

Received on Wed Nov 8 22:12:02 2006

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