You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ivan Zhakov <ch...@gmail.com> on 2006/12/29 17:12:54 UTC
[PATCH] Implement svn rm --keep-local
Hi,
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.
Implementation details
=================
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
file.
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.
* subversion/include/svn_wc.h
(svn_wc_delete3): New function declaration.
(svn_wc_delete2): Deprecate.
(svn_wc_entry_t): Add new field keep_local.
* subversion/include/svn_client.h
(svn_client_delete3): New function.
(svn_client_delete2): Deprecate.
* subversion/libsvn_wc/entries.h
(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.
* subversion/libsvn_wc/entries.c
(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.
* subversion/libsvn_wc/log.c
(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
handle_killme function.
* subversion/libsvn_wc/adm_ops.c
(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.
* subversion/libsvn_wc/adm_files.h
* subversion/libsvn_wc/adm_files.c
(svn_wc__make_killme, svn_wc__check_killme): New functions to make
and check killme file.
* subversion/libsvn_client/delete.c
(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.
* subversion/libsvn_client/client.h
(svn_client__wc_delete): Add keep_local parameter.
* subversion/libsvn_client/diff.c
(merge_file_deleted, merge_dir_deleted): Adjusted calls to
svn_client__wc_delete.
* subversion/svn/cl.h
(svn_cl__longopt_t): Add svn_cl__keep_local_opt.
(svn_cl__opt_state_t): Add keep_local flag.
* subversion/svn/delete-cmd.c
(svn_cl__delete): Use svn_client_delete3 and pass keep_local to it.
* svn/trunk/subversion/svn/main.c
(svn_cl__options, svn_opt_subcommand_desc2_t): Add "--keep-local" option
for delete command.
(main): Handle '--keep-local' option.
* subversion/tests/cmdline/basic_tests.py
(delete_keep_local): New test for deletion with --keep-local.
(test_list): Add test delete_keep_local.
]]]
--
Ivan Zhakov
Re: [PATCH] Implement svn rm --keep-local
Posted by Ivan Zhakov <ch...@gmail.com>.
On 12/29/06, Ivan Zhakov <ch...@gmail.com> wrote:
> Hi,
> 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.
>
> Implementation details
> =================
> 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
> file.
> 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.
>
> * subversion/include/svn_wc.h
> (svn_wc_delete3): New function declaration.
> (svn_wc_delete2): Deprecate.
> (svn_wc_entry_t): Add new field keep_local.
> * subversion/include/svn_client.h
> (svn_client_delete3): New function.
> (svn_client_delete2): Deprecate.
> * subversion/libsvn_wc/entries.h
> (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.
> * subversion/libsvn_wc/entries.c
> (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.
> * subversion/libsvn_wc/log.c
> (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
> handle_killme function.
> * subversion/libsvn_wc/adm_ops.c
> (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.
> * subversion/libsvn_wc/adm_files.h
> * subversion/libsvn_wc/adm_files.c
> (svn_wc__make_killme, svn_wc__check_killme): New functions to make
> and check killme file.
> * subversion/libsvn_client/delete.c
> (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.
> * subversion/libsvn_client/client.h
> (svn_client__wc_delete): Add keep_local parameter.
> * subversion/libsvn_client/diff.c
> (merge_file_deleted, merge_dir_deleted): Adjusted calls to
> svn_client__wc_delete.
> * subversion/svn/cl.h
> (svn_cl__longopt_t): Add svn_cl__keep_local_opt.
> (svn_cl__opt_state_t): Add keep_local flag.
> * subversion/svn/delete-cmd.c
> (svn_cl__delete): Use svn_client_delete3 and pass keep_local to it.
> * svn/trunk/subversion/svn/main.c
> (svn_cl__options, svn_opt_subcommand_desc2_t): Add "--keep-local" option
> for delete command.
> (main): Handle '--keep-local' option.
> * subversion/tests/cmdline/basic_tests.py
> (delete_keep_local): New test for deletion with --keep-local.
> (test_list): Add test delete_keep_local.
> ]]]
>
I've committed in r22940.
--
Ivan Zhakov
http://www.visualsvn.com/ -- Subversion for Visual Studio.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Google Accessibility Fixit Day and Google Zurich?
Posted by Peter Lundblad <pl...@google.com>.
Hello,
Please ignore my last mail with this subject. It was unintentionally sent
to lots of people who weren't the intended recepients.
Please accept my apologies for the inconvenience,
//Peter Lundblad
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Google Accessibility Fixit Day and Google Zurich?
Posted by Peter Lundblad <pl...@google.com>.
Mamie Rheingold writes:
> Thanks Peter!
>
> We will make sure to video tape the talks since the time difference probably
> won't be in your favor in Zurich. We will send T-shirts for you to
I just noticed that there's a talk held in London tomorrow. I'll try to
arrange that we whach that one here next week.
> distribute to anyone who attends the screenings of the talks or participates
> in our "scavenger hunt". Also, it would be great to have your help (and
> anyone else you can recruit) to advertise the fixit by emailing an
> announcement to the Zurich office introducing the fixit and describing how
> people can participate on the day-of (we will have the content of the email
> ready to go, you would just need to send it!). Also, we will have flyers to
Cool! I'll forwward that when the time comes.
> put up for the two weeks leading up to the fixit (scheduled for January 18).
> So if you can get a group of people to plaster the walls with posters, that
> would also we a big help.
>
Will the TGIF video be ready for Friday afternoon (Curich time, UTC+2) so
we can whatch it here as well?
Thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org