You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kobayashi Noritada <no...@dolphin.c.u-tokyo.ac.jp> on 2005/10/19 12:57:44 UTC

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

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

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

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,

In <20...@dolphin.c.u-tokyo.ac.jp>
  "[PATCH] Make tools/examples/svnshell.rb in order." on Wed, 19 Oct 2005 21:57:44 +0900 (JST),
  Kobayashi Noritada <no...@dolphin.c.u-tokyo.ac.jp> wrote:

> 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.

Thank you, nori.
I applied your patch.


Thanks,
--
kou

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org