Labels: Type-Defect Priority-Medium
New issue 3221 by pedro.lu...@gmail.com: get_repository_info in perforce.py
fails if norm_cwd and norm_client_root have different cases.
*** READ THIS BEFORE POSTING!
*** You must complete this form in its entirety, or your bug report will be
*** For customer support, please post to reviewbo...@googlegroups.com
*** If you have a patch, please submit it to
*** Do not post confidential information in this bug report!
What version are you running?
What's the URL of the page containing the problem?
it's in the rbtools python scripts, in perforce.py, no URL.
What steps will reproduce the problem?
1. Set your client root to C:\your_root_here in P4
2. Check that you root path with P4 client to c:\your_root_here (notice the
3. Run rbt post --debug and see it fail
What is the expected output? What do you see instead?
rbt fails to detect a repository in the root directory
What operating system are you using? What browser?
Please provide any additional information below.
I debugged this and found the issue:
When the path case doesn't match between norm_cwd and norm_client_root the
function returns None.
The solution is to call os.path.normcase for both norm_cwd and
norm_client_root as below:
if not self.p4.is_supported():
p4_info = self.p4.info()
# For the repository path, we first prefer p4 brokers, then the
# upstream p4 server. If neither of those are found, just return
repository_path = (p4_info.get('Broker address') or
if repository_path is None:
client_root = p4_info.get('Client root')
if client_root is None:
norm_cwd = os.path.normcase(os.path.realpath(os.getcwd()) +
norm_client_root = os.path.normcase(os.path.realpath(client_root) +
# Don't accept the repository if the current directory is outside
# root of the Perforce client.
if not norm_cwd.startswith(norm_client_root):
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/groups/opt_out.