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>
Simon Hausmann committed
Mar 10, 2007 at 21:23 UTC
dd87020bd3969dbac5ae26c527bcf50fe0ebb845
1 file changed
+7
-1
contrib/fast-import/p4-fast-export.py
+7
-1
@@ -415,6 +415,7 @@ def changeIsBranchMerge(sourceBranch, destinationBranch, change):
415
for fileName in sourceFiles.keys():
416
integrations = []
417
deleted = False
418
+ integrationCount = 0
419
for integration in p4CmdList("integrated \"%s\"" % fileName):
420
toFile = integration["fromFile"] # yes, it's true, it's fromFile
421
if not toFile in destinationFiles:
@@ -424,10 +425,15 @@ def changeIsBranchMerge(sourceBranch, destinationBranch, change):
425
# print "file %s has been deleted in %s" % (fileName, toFile)
426
deleted = True
427
break
428
+ integrationCount += 1
429
+ if integration["how"] == "branch from":
430
+ continue
431
432
if int(integration["change"]) == change:
433
integrations.append(integration)
434
continue
435
+ if int(integration["change"]) > change:
436
+ continue
437
438
destRev = int(destFile["rev"])
439
@@ -453,7 +459,7 @@ def changeIsBranchMerge(sourceBranch, destinationBranch, change):
459
if deleted:
460
continue
461
456
- if len(integrations) == 0:
462
+ if len(integrations) == 0 and integrationCount > 1:
463
print "file %s was not integrated from %s into %s" % (fileName, sourceBranch, destinationBranch)
464
return False
465