MCPcopy Index your code
hub / github.com/git/git / findUpstreamBranchPoint

Function findUpstreamBranchPoint

git-p4.py:1180–1213  ·  view source on GitHub ↗
(head="HEAD")

Source from the content-addressed store, hash-verified

1178
1179
1180def findUpstreamBranchPoint(head="HEAD"):
1181 branches = p4BranchesInGit()
1182 # map from depot-path to branch name
1183 branchByDepotPath = {}
1184 for branch in branches.keys():
1185 tip = branches[branch]
1186 log = extractLogMessageFromGitCommit(tip)
1187 settings = extractSettingsGitLog(log)
1188 if "depot-paths" in settings:
1189 git_branch = "remotes/p4/" + branch
1190 paths = ",".join(settings["depot-paths"])
1191 branchByDepotPath[paths] = git_branch
1192 if "change" in settings:
1193 paths = paths + ";" + settings["change"]
1194 branchByDepotPath[paths] = git_branch
1195
1196 settings = None
1197 parent = 0
1198 while parent < 65535:
1199 commit = head + "~%s" % parent
1200 log = extractLogMessageFromGitCommit(commit)
1201 settings = extractSettingsGitLog(log)
1202 if "depot-paths" in settings:
1203 paths = ",".join(settings["depot-paths"])
1204 if "change" in settings:
1205 expaths = paths + ";" + settings["change"]
1206 if expaths in branchByDepotPath:
1207 return [branchByDepotPath[expaths], settings]
1208 if paths in branchByDepotPath:
1209 return [branchByDepotPath[paths], settings]
1210
1211 parent = parent + 1
1212
1213 return ["", settings]
1214
1215
1216def createOrUpdateBranchesFromOrigin(localRefPrefix="refs/remotes/p4/", silent=True):

Callers 3

prepareSubmitTemplateMethod · 0.85
runMethod · 0.85
rebaseMethod · 0.85

Calls 3

p4BranchesInGitFunction · 0.85
extractSettingsGitLogFunction · 0.85

Tested by

no test coverage detected