https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
Add the junk command.
* vcs/lib/vcs/junk.rb: New.
* vcs/NEWS: Add an entry for junk.
NEWS | 2 ++
lib/vcs/junk.rb | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
Index: vcs/lib/vcs/junk.rb
--- vcs/lib/vcs/junk.rb (revision 0)
+++ vcs/lib/vcs/junk.rb (revision 0)
@@ -0,0 +1,26 @@
+# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
+# Author:: Nicolas Pouillard <ertai(a)lrde.epita.fr>fr>.
+# License:: Gnu General Public License.
+# Revision:: $Id$
+
+
+class Vcs
+
+ # This command removes all junk files (by default all files begining with `,').
+ # Warning: this command removes some files that may contains some relevant
+ # information. For example during a commit the information that you type is
+ # stored in one of these `,files'. So be careful using this command.
+ # See the user configuration to customize what is considered as a junk file.
+ def junk! ( files=[], options={} )
+ list!(files, options.merge(:junk => true)) do |path_list|
+ path_list.each { |path| logger.info { "Remove #{path}" } }
+ if @h.agree('Are you sure? (y/n)', true)
+ path_list.each do |path|
+ logger.info { "Removing #{path}..." }
+ path.rm_f
+ end
+ end
+ end
+ end
+
+end # class Vcs
Property changes on: vcs/lib/vcs/junk.rb
___________________________________________________________________
Name: svn:keywords
+ Id
Index: vcs/NEWS
--- vcs/NEWS (revision 247)
+++ vcs/NEWS (working copy)
@@ -57,6 +57,8 @@
- svn list --junk --do rm
- svn list --precious --do wc
+ - svn junk: This command use `list' to remove all junk files.
+
New in 0.3 2005-09-16:
* The help command now show all commands including vcs ones.