1970: postreview mangles repository path when protocol is part of path

henr*****@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Feb. 9, 2011
What version are you running?
RBTools 0.3 on ReviewBoard 1.5.1


What steps will reproduce the problem?
1. Create a CVS respository in ReviewBoard using :ext:
2. Checkout code from CVS respository where CVSROOT contains :ext:
3. Modify code and run post-review to generate review request.

What is the expected output? What do you see instead?
The expected output is a successful review request posted on ReviewBoard located at http://hyei6/reviewboard/ for the :ext:cvs-server:/cvsdev/test repository.

[Fail output]
hyei@hyei-desktop-linux:~/workspace/test_branch/testdir$ post-review --server="http://hyei6/reviewboard/"
Password:
==> Review Board Login Required
Enter username and password for Review Board at http://hyei6/reviewboard/

There was an error creating this review request.

The repository path "hyei-desktop-linux:exthyei-desktop-linux:cvs-serverhyei-desktop-linux:/cvsdev/test" is not in the
list of known repositories on the server.

Ask the administrator to add this repository to the Review Board server.
For information on adding repositories, please read
http://www.reviewboard.org/docs/manual/dev/admin/management/repositories


What operating system are you using? What browser?
Ubuntu 9.04 (64)

Please provide any additional information below.

I've attached a patch that fixes the issue for me. Instead of looking for the first colon, it looks for the last colon when attempting to replace the host name.

Python 2.6.2 was used.
--- postreview.py.orig	2011-02-02 16:56:04.076434258 -0800
+++ postreview.py	2011-02-02 16:56:29.736433578 -0800
@@ -1120,7 +1120,7 @@
         if i != -1:
             repository_path = repository_path[i + 1:]
 
-        i = repository_path.find(":")
+        i = repository_path.rfind(":")
         if i != -1:
             host = repository_path[:i]
             try:
chipx86
#1 chipx86
Fixed on master (ff2a4c9c1971c41ff87e130d2ce24bb0b05012df)
  • +Fixed
  • +Component-RBTools
    +Milestone-RBTools-Release1.0
  • +chipx86