Attached patch adds option "--keep-local" to svn rm command. With this
option files and directories will be removed only from repository, but
it will remain in *current* working copy. This means that path will be
removed in other working copies after performing update.
Keeping files is very easy: just don't remove them if --keep-local
option is specified.
Handling directories a little bit harder, because they are removed
after commit. So I've implemented storing boolean flag keep_local in
"this_dir" entry. When Subversion is processing log_do_commited
command for deletion it looks for keep_local flag and remove only
administrative directory if keep_local is TRUE.
I have only one question: is format bump required in such situation? I
added only new field to entries file and special meaning for contents
of killme file. So if older client will use new working copy, it will
just ignore new entry field (keep_local) and ignore contents of killme
Of course directory will be removed from disk after commit, but I
think it's not a problem.
I've not been writing Subversion code for several month so I'm posting
my patch here :)
Add option "--keep-local" to svn rm command to keep deleted path in
current working copy.
To keep files just don't remove them. For directories set keep_local
flag to TRUE on "this_dir" entry and use it in log_do_commited.
(svn_wc_delete3): New function declaration.
(svn_wc_entry_t): Add new field keep_local.
(svn_client_delete3): New function.
(SVN_WC__ENTRY_ATTR_KEEP_LOCAL): New entry attribute...
(SVN_WC__ENTRY_MODIFY_KEEP_LOCAL): ...And new modification flag for it.
(SVN_WC__ENTRY_MODIFY_ALL, SVN_WC__ENTRY_MODIFY_FORCE): Update.
(svn_wc__atts_to_entry): Parse 'keep-local'.
(read_entry, write_entry): Read and write new entry field keep_local.
(fold_entry): Reset keep_local to FALSE if not scheduled for deletion.
* subversion/libsvn_wc/wc.h (SVN_WC__KILL_ADM_ONLY): New.
(log_do_committed): Use svn_wc__make_killme and pass keep_local to it.
(handle_killme): Destroy only administrative area if kill_adm_only is TRUE.
(run_log, svn_wc_cleanup2): Check for killme file using
svn_wc__check_killme and pass kill_adm_only flag to
(svn_wc_delete2): Reimplement via wrapper to svn_wc_delete3.
(svn_wc_delete3): Copied from svn_wc_delete2. Add with keep_local flag
and pass it to mark_tree. Keep files on disk if keep_local is TRUE.
(mark_tree): Set keep_local on "this_dir" if requested.
(svn_wc__make_killme, svn_wc__check_killme): New functions to make
and check killme file.
(svn_client__wc_delete): Add keep_local parameter and pass it to
svn_wc_delete3. Don't check for "awkward" files if keep_local is TRUE.
(svn_client_delete2): Reimplement via wrapper to svn_client_delete3.
(svn_client_delete3): New function, takes keep_local.
(svn_client__wc_delete): Add keep_local parameter.
(merge_file_deleted, merge_dir_deleted): Adjusted calls to
(svn_cl__longopt_t): Add svn_cl__keep_local_opt.
(svn_cl__opt_state_t): Add keep_local flag.
(svn_cl__delete): Use svn_client_delete3 and pass keep_local to it.
(svn_cl__options, svn_opt_subcommand_desc2_t): Add "--keep-local" option
for delete command.
(main): Handle '--keep-local' option.
(delete_keep_local): New test for deletion with --keep-local.
(test_list): Add test delete_keep_local.
Received on Fri Dec 29 18:13:06 2006
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com