Make it possible to specify the HEAD for the internal findUpstreamBranchPoint function.
This isn't used right now in git-p4 but I use it in an external script that loads git-p4 as module. Signed-off-by: Simon Hausmann <shausman@trolltech.com>
This commit is contained in:
parent
09d89de2e3
commit
9ceab36375
@ -168,12 +168,12 @@ def gitBranchExists(branch):
|
|||||||
def gitConfig(key):
|
def gitConfig(key):
|
||||||
return read_pipe("git config %s" % key, ignore_error=True).strip()
|
return read_pipe("git config %s" % key, ignore_error=True).strip()
|
||||||
|
|
||||||
def findUpstreamBranchPoint():
|
def findUpstreamBranchPoint(head = "HEAD"):
|
||||||
settings = None
|
settings = None
|
||||||
branchPoint = ""
|
branchPoint = ""
|
||||||
parent = 0
|
parent = 0
|
||||||
while parent < 65535:
|
while parent < 65535:
|
||||||
commit = "HEAD~%s" % parent
|
commit = head + "~%s" % parent
|
||||||
log = extractLogMessageFromGitCommit(commit)
|
log = extractLogMessageFromGitCommit(commit)
|
||||||
settings = extractSettingsGitLog(log)
|
settings = extractSettingsGitLog(log)
|
||||||
if not settings.has_key("depot-paths"):
|
if not settings.has_key("depot-paths"):
|
||||||
|
Loading…
Reference in New Issue
Block a user