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

[PATCH] Make tools/examples/svnshell.rb in order.

From: Kobayashi Noritada <nori1_at_dolphin.c.u-tokyo.ac.jp>
Date: 2005-10-19 14:57:44 CEST

Hi,

A sample script, tools/examples/svnshell.rb, seems to be a little bit
out of order for now.
So, I created a patch to fix it.
Please review it.

Thanks,

-nori

[[[
Fix three defects of tools/examples/svnshell.rb; failure of 'ls' and
of 'lstxns' and 'pcat' interpreting its argument as an absolute path.

* tools/examples/svnshell.rb
  (SvnShell::do_ls): Format internally date, which is not a String but
  a Time object now, without the help of SvnShell::format_date.
  (SvnShell::do_lstxns): Make use of Svn::Fs::FileSystem#transactions.
  (SvnShell::do_pcat): Normalize paths given.
  (SvnShell::format_date): Deleted since it is no use.
]]]

Index: tools/examples/svnshell.rb
===================================================================
--- tools/examples/svnshell.rb (revision 16815)
+++ tools/examples/svnshell.rb (working copy)
@@ -233,7 +233,7 @@
         date = @fs.prop(Svn::Core::PROP_REVISION_DATE, created_rev)
         args = [
           created_rev, author[0,8],
- node_id, size, format_date(date), name
+ node_id, size, date.strftime("%b %d %H:%M(%Z)"), name
         ]
         puts "%6s %8s <%10s> %8s %17s %s" % args
         
@@ -245,7 +245,7 @@
   def do_lstxns
     
     # Get a sorted list of open transactions
- txns = @fs.list_transactions
+ txns = @fs.transactions
     txns.sort
     counter = 0
     
@@ -267,7 +267,7 @@
   def do_pcat(path=nil)
     
     # Default to the current directory
- catpath = path || @path
+ catpath = path ? normalize_path(path) : @path
 
     # Make sure that the specified path exists
     if @root.check_path(catpath) == Svn::Core::NODE_NONE
@@ -431,12 +431,6 @@
       find_available_path(parent_dir(path))
     end
   end
-
- # Format a date for output in a standard format
- def format_date(date_str)
- date = Svn::Util.string_to_time(date_str)
- date.strftime("%b %d %H:%M(%Z)")
- end
   
 end
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 19 15:01:13 2005

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