[LrdeTools] 265: Add --auto option for add and delete.

https://svn.lrde.epita.fr/svn/lrdetools/trunk Index: ChangeLog from Nicolas Pouillard <ertai@lrde.epita.fr> Add --auto option for add and delete. * vcs/lib/vcs/add.rb: New. * vcs/lib/vcs/delete.rb: New. add.rb | 21 +++++++++++++++++++++ delete.rb | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) Index: vcs/lib/vcs/add.rb --- vcs/lib/vcs/add.rb (revision 0) +++ vcs/lib/vcs/add.rb (revision 0) @@ -0,0 +1,21 @@ +# Copyright:: Copyright (c) 2005 LRDE. All rights reserved. +# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>. +# License:: Gnu General Public License. +# Revision:: $Id$ + +class Vcs + + specific_options << '--auto' + + def add! ( files=[], options={} ) + if options[:auto] + options.delete(:auto) + list!(files, :unrecognize => true) do |path_list| + add_!(path_list.stringify, options) unless path_list.empty? + end + else + add_!(files, options) + end + end + +end # class Vcs \ No newline at end of file Property changes on: vcs/lib/vcs/add.rb ___________________________________________________________________ Name: svn:keywords + Id Index: vcs/lib/vcs/delete.rb --- vcs/lib/vcs/delete.rb (revision 0) +++ vcs/lib/vcs/delete.rb (revision 0) @@ -0,0 +1,21 @@ +# Copyright:: Copyright (c) 2005 LRDE. All rights reserved. +# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>. +# License:: Gnu General Public License. +# Revision:: $Id$ + +class Vcs + + specific_options << '--auto' + + def delete! ( files=[], options={} ) + if options[:auto] + options.delete(:auto) + list!(files, :missing => true) do |path_list| + delete_!(path_list.stringify, options) unless path_list.empty? + end + else + delete_!(files, options) + end + end + +end # class Vcs Property changes on: vcs/lib/vcs/delete.rb ___________________________________________________________________ Name: svn:keywords + Id
participants (1)
-
Nicolas Pouillard