You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bhuvaneswaran Arumugam <bh...@collab.net> on 2006/07/27 06:36:13 UTC
[PATCH] SVN Shell
Hello,
Please find attached the patch. The patch contains following fixes
(since they are trivial, i've combined them in one patch):
1. Improve the output format of "ls" command.
2. If no argument is passed to "setrev" command, set it to the
youngest.
3. Bug fix: Fix the exception when non-numeric data is passed as an
argument to "setrev" command.
[[
* tools/examples/svnshell.py
(SVNShell.do_ls): Improve the output format of "ls" command.
(SVNShell.do_setrev): If no argument is passed to "setrev" command,
set it to the youngest.
Bug fix: Fix the exception when non-numeric data is passed as an
argument to "setrev" command.
]]
--
Regards,
Bhuvaneswaran
Re: [PATCH] SVN Shell
Posted by Max Bowsher <ma...@ukf.net>.
Bhuvaneswaran Arumugam wrote:
> Index: tools/examples/svnshell.py
> ===================================================================
> --- tools/examples/svnshell.py (revision 20873)
> +++ tools/examples/svnshell.py (working copy)
> @@ -121,7 +121,7 @@
> keys = entries.keys()
> keys.sort()
>
> - print " REV AUTHOR NODE-REV-ID SIZE DATE NAME"
> + print " REV AUTHOR NODE-REV-ID SIZE DATE NAME"
> print "----------------------------------------------------------------------------"
>
> for entry in keys:
> @@ -146,8 +146,8 @@
> else:
> date = self._format_date(date)
>
> - print "%6s %8s <%10s> %8s %12s %s" % (created_rev, author[:8],
> - node_id, size, date, name)
> + print "%6s %8s %15s %8s %12s %s" % (created_rev, author[:8],
> + "<" + node_id + ">", size, date, name)
I agree that node-rev-ids need more space, but names can be pretty long
too. Also the angle brackets are fairly irrelevant. So, I just traded
the angle brackets for two more columns, not five more, to gain a little
without eroding the name column.
> @@ -184,10 +184,14 @@
> def do_setrev(self, arg):
> """set the current revision to view"""
> try:
> - rev = int(arg)
> + if len(arg) == 0:
> + rev = int(fs.youngest_rev(self.fs_ptr))
> + print "Setting the revision to youngest revision '%d'." % rev
> + else:
> + rev = int(arg)
> newroot = fs.revision_root(self.fs_ptr, rev)
> except:
> - print "Error setting the revision to '" + str(rev) + "'."
> + print "Error setting the revision to '" + arg + "'."
Instead I chose to make setrev accept "HEAD" as a parameter. I think
this is more in line with what people might imagine, given the behaviour
of subversion itself.
Also, the explicit message is not needed, since the prompt will advise
people of the revision anyway.
Committed r20992.
Max.