1020: [PATCH] post-review with perforce does not work with pending changesets

mw.t****@gmai***** (Google Code) (Is this you? Claim this profile.)
Sept. 22, 2009
The current (as of about 2009-03-28) version of post-review is unable to
understand pending changesets in perforce. The attached patch adds this
support.
--- /usr/lib/python2.5/site-packages/ReviewBoard-1.0alpha4-py2.5.egg/reviewboard/contrib/tools/post-review	2009-03-12 14:48:02.000000000 -0500
+++ src/post-review	2009-03-31 18:30:27.000000000 -0500
@@ -1345,10 +1345,11 @@
 
         cl_is_pending = False
 
-        try:
-            changenum = int(changenum)
-        except ValueError:
-            die("You must enter a valid change number")
+        if changenum != "default":
+            try:
+                changenum = int(changenum)
+            except ValueError:
+                die("You must enter a valid change number")
 
         debug("Generating diff for changenum %s" % changenum)
 
@@ -1359,23 +1360,39 @@
         if options.p4_port:
            os.environ['P4PORT'] = options.p4_port
 
+        description = ""
 
-        description = execute(["p4", "describe", "-s", str(changenum)],
-                              split_lines=True)
-
-        if '*pending*' in description[0]:
+        if changenum == "default":
        
david
#1 david
  • +Fixed