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

[PATCH] Simplify svnshell.rb example script and add documentation

From: David James <james82_at_gmail.com>
Date: 2005-06-15 22:34:02 CEST

This patch simplifies the svnshell.rb example script and adds documentation.

svnshell.rb:
  (SvnShell): Added lots of documentation. Got rid of the 'in_rev_mode'
    variable. We now test for txn.nil? instead. Switched style of 'case'
    statements so that when/else statements are indented.
  (SvnShell.initialize): Refactor some of the code into a get_youngest_rev
     method for getting the youngest revision of the repository
  (SvnShell.run): Check for cmd.nil? so that we skip entirely empty lines
  (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.path_to_parts): Added 'return' statement to emphasize that the
    return value of this function is important
  (SvnShell.parse_path): Renamed to normalize_path. Added 'return' statement
    to emphasize that the return value of this function is important
  (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.

Cheers,

David

-- 
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 Wed Jun 15 22:35:00 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.