Merge branch 'va/p4-client-path'
git p4 attempts to better handle branches in Perforce. * va/p4-client-path: git-p4: improve client path detection when branches are used t9801: check git-p4's branch detection with client spec enabled
This commit is contained in:
13
git-p4.py
13
git-p4.py
@ -502,12 +502,14 @@ def p4Cmd(cmd):
|
||||
def p4Where(depotPath):
|
||||
if not depotPath.endswith("/"):
|
||||
depotPath += "/"
|
||||
depotPath = depotPath + "..."
|
||||
outputList = p4CmdList(["where", depotPath])
|
||||
depotPathLong = depotPath + "..."
|
||||
outputList = p4CmdList(["where", depotPathLong])
|
||||
output = None
|
||||
for entry in outputList:
|
||||
if "depotFile" in entry:
|
||||
if entry["depotFile"] == depotPath:
|
||||
# Search for the base client side depot path, as long as it starts with the branch's P4 path.
|
||||
# The base path always ends with "/...".
|
||||
if entry["depotFile"].find(depotPath) == 0 and entry["depotFile"][-4:] == "/...":
|
||||
output = entry
|
||||
break
|
||||
elif "data" in entry:
|
||||
@ -1653,7 +1655,10 @@ class P4Submit(Command, P4UserMap):
|
||||
if self.useClientSpec:
|
||||
self.clientSpecDirs = getClientSpec()
|
||||
|
||||
if self.useClientSpec:
|
||||
# Check for the existance of P4 branches
|
||||
branchesDetected = (len(p4BranchesInGit().keys()) > 1)
|
||||
|
||||
if self.useClientSpec and not branchesDetected:
|
||||
# all files are relative to the client spec
|
||||
self.clientPath = getClientRoot()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user