399: post-review doesn't fail nicely when you forget to give it a change #

josep******@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 9, 2008
* What steps will reproduce the problem?
1. Invoke post-review with a server (or have server in config file) but
without a change list number

 * What is the expected output? What do you see instead?

Expected an error message:
Unable to find a Review Board server for this source code tree.

Actually got:
{{{
Traceback (most recent call last):
  File "C:\p4\p4-tss\tools\main\dev\post-review.py", line 860, in ?
    main(sys.argv[1:])
  File "C:\p4\p4-tss\tools\main\dev\post-review.py", line 819, in main
    parser.error("specify the change number of a pending changeset")
NameError: global name 'parser' is not defined
}}}


 * What operating system are you using? What browser?

Win32, Python 2.5.1

Please provide any additional information below.

Looks like a refactoring bug from some time back. I'm attaching a diff that
I believe will resolve.
Index: post-review
===================================================================
--- post-review (revision 1159)
+++ post-review (working copy)
@@ -808,7 +808,8 @@
     if repository_info.supports_changesets:
         if len(args) != 1:
-            parser.error("specify the change number of a pending changeset")
+            print "specify the change number of a pending changeset"
+            sys.exit(1)
         changenum = args[0]
         files = None
david
#1 david
Applied to SVN.  Thanks!

This patch was small enough not to matter, but in future, please submit them to our
Review Board instance at http://reviews.review-board.org/
  • +Fixed