зеркало из https://github.com/microsoft/git.git
git p4: add comments to p4BranchesInGit
Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
991a2de45a
Коммит
2c8037edee
19
git-p4.py
19
git-p4.py
|
@ -548,6 +548,12 @@ def gitConfigList(key):
|
|||
return _gitConfig[key]
|
||||
|
||||
def p4BranchesInGit(branchesAreInRemotes=True):
|
||||
"""Find all the branches whose names start with "p4/", looking
|
||||
in remotes or heads as specified by the argument. Return
|
||||
a dictionary of { branch: revision } for each one found.
|
||||
The branch names are the short names, without any
|
||||
"p4/" prefix."""
|
||||
|
||||
branches = {}
|
||||
|
||||
cmdline = "git rev-parse --symbolic "
|
||||
|
@ -559,15 +565,18 @@ def p4BranchesInGit(branchesAreInRemotes = True):
|
|||
for line in read_pipe_lines(cmdline):
|
||||
line = line.strip()
|
||||
|
||||
## only import to p4/
|
||||
if not line.startswith('p4/') or line == "p4/HEAD":
|
||||
# only import to p4/
|
||||
if not line.startswith('p4/'):
|
||||
continue
|
||||
# special symbolic ref to p4/master
|
||||
if line == "p4/HEAD":
|
||||
continue
|
||||
branch = line
|
||||
|
||||
# strip off p4
|
||||
branch = re.sub ("^p4/", "", line)
|
||||
# strip off p4/ prefix
|
||||
branch = line[len("p4/"):]
|
||||
|
||||
branches[branch] = parseRevision(line)
|
||||
|
||||
return branches
|
||||
|
||||
def findUpstreamBranchPoint(head = "HEAD"):
|
||||
|
|
Загрузка…
Ссылка в новой задаче