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

Re: [PATCH] Simplify svnshell.rb example script (v2)

From: David James <james82_at_gmail.com>
Date: 2005-06-16 18:53:52 CEST

On 6/16/05, Kouhei Sutou <kou@cozmixng.org> wrote:
> > This patch simplifies the svnshell.rb example script and adds documentation.
> Could you split the patch into simplifying script patch and
> adding documentation patch?
Sure. It probably makes sense to do the 'simplifying script' patch
first since the changes to the script will affect the documentation.

I have removed all of the documentation and whitespace changes from my
patch. The new version is attached. Once you have decided which of my
changes to include, I will submit a new patch to add documentation.

* tools/examples/svnshell.rb:
 (SvnShell): Got rid of the 'in_rev_mode' variable. We now test for
   txn.nil? instead.
 (SvnShell.initialize): Refactor some of the code into a
   get_youngest_rev method for getting the youngest revision of the
 (SvnShell.run): Check for cmd.nil? so that we skip entirely empty
 (SvnShell.dispatch): Capitalize first letter of error messages. Added
   a list of valid commands to the 'Unknown command' message.
 (SvnShell.do_cat): Renamed new_path variable to normalized_path.
 (SvnShell.do_cd): Renamed new_path variable to normalized_path.
 (SvnShell.do_ls): Output error message when directory entry is not
   found for an existing file. Keep printing 'ls' output after
   encountering file that does not exist (like the UNIX ls). Renamed
   new_path variable to normalized_path.
 (SvnShell.do_settxn): Got rid of unnecessary new_root variable.
 (SvnShell.parse_path): Renamed to normalize_path.
 (SvnShell.parent_dir): Created new helper function for finding the
   parent directory of a specified path
 (SvnShell.path_landing): Renamed to find_landing_path. Simplified
   function by reimplementing it in a tail-recursive manner. Instead
   of modifying @path, we now return the value.



David James -- http://www.cs.toronto.edu/~james

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

Received on Thu Jun 16 18:57:30 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.