Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding check for refs/remotes/p4/master when testing for git-p4

  • Loading branch information...
commit 74b297bcf6bd508731a6a8435d719af8bc08c64d 1 parent d2f8c4b
@cvanes authored
Showing with 10 additions and 6 deletions.
  1. +4 −0 .gitignore
  2. +6 −6 rbtools/clients/git.py
View
4 .gitignore
@@ -0,0 +1,4 @@
+*.pyc
+RBTools.egg-info/
+build/
+dist/
View
12 rbtools/clients/git.py
@@ -127,14 +127,14 @@ def get_repository_info(self):
die("Your installation of git-svn must be upgraded to "
"version 1.5.4 or later")
- # Okay, maybe Perforce.
- data = execute(["git", "config", '--get', "git-p4.port"], ignore_errors=True)
+ # Okay, maybe Perforce/git-p4.
+ git_p4_ref = os.path.join(git_dir, 'refs', 'remotes', 'p4', 'master')
+ data = execute([self.git, 'config', '--get', 'git-p4.port'], ignore_errors=True)
m = re.search(r'(.+)', data)
- if m:
+ if os.path.exists(git_p4_ref) and m:
port = m.group(1)
- self.type = "perforce"
- self.upstream_branch = "remotes/p4/master"
- # TODO hef: figure out what a base path is and add it here
+ self.type = 'perforce'
+ self.upstream_branch = 'remotes/p4/master'
return RepositoryInfo(path=port, base_path='', supports_parent_diffs=True)
# Nope, it's git then.
Please sign in to comment.
Something went wrong with that request. Please try again.