Git-p4 fixes for newer Perforce versions

Review Request #5120 — Created Dec. 16, 2013 and submitted

Information

RBTools
master

Reviewers

Different versions of perforce / git appear to use various naming schemes for perforce variables. This fix updates the regular expression to match two known names for the perforce path variable.

Testing was done on a git-p4 checkout using the latest release versions of Git and Perforce, with the latest HEAD of RBTools with this fix applied. The issue described in https://code.google.com/p/reviewboard/issues/detail?id=3169 no longer appears.

$ post-review -d

RBTools 0.5.2
Python 2.7.5 (default, Nov 12 2013, 16:18:42)
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)]
Running on Linux-3.11.10-200.fc19.x86_64-x86_64-with-fedora-19-Schrödinger’s_Cat
Home = /home/dreid
Current Directory = /home/dreid/git-p4/naples
Checking the repository type. Errors shown below are mostly harmless.
DEBUG:root:Checking for a Subversion repository...
DEBUG:root:Running: svn info --non-interactive
DEBUG:root:Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: E155007: '/home/dreid/git-p4/naples' is not a working copy


DEBUG:root:Checking for a Git repository...
DEBUG:root:Running: git rev-parse --git-dir
DEBUG:root:Running: git config core.bare
DEBUG:root:Running: git rev-parse --show-toplevel
DEBUG:root:Running: git symbolic-ref -q HEAD
DEBUG:root:Running: git config --get git-p4.port
DEBUG:root:repository info: Path: someserver.com:1666, Base path: , Supports changesets: False

Finished checking the repository type.
DEBUG:root:Running: git config --get reviewboard.url
HTTP GETting api/info/
DEBUG:root:Running: git merge-base remotes/p4/master refs/heads/dan-test
DEBUG:root:Running: git diff --no-color --no-prefix -r -u p4
DEBUG:root:Running: git log p4
DEBUG:root:Running: p4 files //utp_depot/projects/Exchange/XDP/xdp_naples_branch/release_1.1.0/run.py@5241975
DEBUG:root:Running: git diff --no-color --no-prefix -r -u 3532e2c4cd4fe49400457cb0568bfa9ac5be383a..p4
DEBUG:root:Running: git log 3532e2c4cd4fe49400457cb0568bfa9ac5be383a
HTTP GETting api/
HTTP GETting http://10.10.204.56:7004/api/info/
Using the new web API
Attempting to create review request on someserver.com:1666 for None
HTTP POSTing to http://10.10.204.56:7004/api/review-requests/: {'repository': 'someserver:1666'}
==> HTTP Authentication Required
Enter authorization information for "Web API" at 10.10.204.56:7004
Username: dreid
Password:
Review request created
Uploading diff, size: 2012
HTTP POSTing to http://10.10.204.56:7004/api/review-requests/910/diffs/: {}
Review request #910 posted.

http://10.10.204.56:7004/r/910/

chipx86
  1. Ship It!
  2. 
      
ST
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.5.x (0f88c6a)