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.
Received on Sat Aug 5 19:37:08 2006