Reduce the number of false "merges" by skipping "branch from" entries in the integrated output as well as by ignoring integrations of future (newer) changes.
Signed-off-by: Simon Hausmann <hausmann@kde.org>maint
parent
43cc31e8a2
commit
dd87020bd3
|
@ -415,6 +415,7 @@ def changeIsBranchMerge(sourceBranch, destinationBranch, change):
|
||||||
for fileName in sourceFiles.keys():
|
for fileName in sourceFiles.keys():
|
||||||
integrations = []
|
integrations = []
|
||||||
deleted = False
|
deleted = False
|
||||||
|
integrationCount = 0
|
||||||
for integration in p4CmdList("integrated \"%s\"" % fileName):
|
for integration in p4CmdList("integrated \"%s\"" % fileName):
|
||||||
toFile = integration["fromFile"] # yes, it's true, it's fromFile
|
toFile = integration["fromFile"] # yes, it's true, it's fromFile
|
||||||
if not toFile in destinationFiles:
|
if not toFile in destinationFiles:
|
||||||
|
@ -424,10 +425,15 @@ def changeIsBranchMerge(sourceBranch, destinationBranch, change):
|
||||||
# print "file %s has been deleted in %s" % (fileName, toFile)
|
# print "file %s has been deleted in %s" % (fileName, toFile)
|
||||||
deleted = True
|
deleted = True
|
||||||
break
|
break
|
||||||
|
integrationCount += 1
|
||||||
|
if integration["how"] == "branch from":
|
||||||
|
continue
|
||||||
|
|
||||||
if int(integration["change"]) == change:
|
if int(integration["change"]) == change:
|
||||||
integrations.append(integration)
|
integrations.append(integration)
|
||||||
continue
|
continue
|
||||||
|
if int(integration["change"]) > change:
|
||||||
|
continue
|
||||||
|
|
||||||
destRev = int(destFile["rev"])
|
destRev = int(destFile["rev"])
|
||||||
|
|
||||||
|
@ -453,7 +459,7 @@ def changeIsBranchMerge(sourceBranch, destinationBranch, change):
|
||||||
if deleted:
|
if deleted:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if len(integrations) == 0:
|
if len(integrations) == 0 and integrationCount > 1:
|
||||||
print "file %s was not integrated from %s into %s" % (fileName, sourceBranch, destinationBranch)
|
print "file %s was not integrated from %s into %s" % (fileName, sourceBranch, destinationBranch)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue