Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3221 by get_repository_info in fails if norm_cwd and norm_client_root have different cases.

*** You must complete this form in its entirety, or your bug report will be
*** For customer support, please post to
*** If you have a patch, please submit it to
*** Do not post confidential information in this bug report!

What version are you running?
rbtools 0.5.7
python 2.7.3

What's the URL of the page containing the problem?
it's in the rbtools python scripts, in, 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 lowercase c:\)
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?
Windows 7

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:

 def get_repository_info(self):
        if not self.p4.is_supported():
            return None

        p4_info =

        # For the repository path, we first prefer p4 brokers, then the
# upstream p4 server. If neither of those are found, just return None.
        repository_path = (p4_info.get('Broker address') or
                           p4_info.get('Server address'))

        if repository_path is None:
            return None

        client_root = p4_info.get('Client root')

        if client_root is None:
            return None

norm_cwd = os.path.normcase(os.path.realpath(os.getcwd()) + os.path.sep) norm_client_root = os.path.normcase(os.path.realpath(client_root) + os.path.sep)

# Don't accept the repository if the current directory is outside the
        # root of the Perforce client.
        if not norm_cwd.startswith(norm_client_root):
            return None

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 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to