Fix port splitting logic to accomodate ssl: repositories for perforce.
Review Request #3719 — Created Jan. 5, 2013 and submitted
Fix port splitting logic to accomodate ssl: repositories for perforce. If the perforce server uses ssl, there will be two colons in the P4PORT path specifier. This would break our port-splitting logic.
Description | From | Last Updated |
---|---|---|
Maybe add a limit to the split, in case for some reason they put in another ":"? I know it … |
chipx86 | |
Blank lines around this. |
chipx86 | |
Col: 29 E127 continuation line over-indented for visual indent |
reviewbot | |
We repeat this twice. Maybe instead, have an is_valid flag, and check it after our if/elif/else, and die if set. |
chipx86 | |
Blank line. |
chipx86 |
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: rbtools/clients/perforce.py Ignored Files:
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: rbtools/clients/perforce.py Ignored Files:
SM
-
-
Personally I'd prefer something along the lines of: parts = repository_path.split(':') hostname = None if len(parts) == 3 and parts[0] == 'ssl': hostname, port = parts[1:] elif len(parts) == 2: hostname, port = parts if hostname is None die('Path %s is not a valid Perforce P4PORT' % repository_path I'm fine with the way it is though, so you can make the call.