+ if not path.startswith(branchPrefix):
+ continue
+ action = file["action"]
+ if action != "integrate" and action != "branch":
+ continue
+ rev = file["rev"]
+ depotPath = path + "#" + rev
+
+ log = p4CmdList("filelog \"%s\"" % depotPath)
+ if len(log) != 1:
+ print "eek! I got confused by the filelog of %s" % depotPath
+ sys.exit(1);
+
+ log = log[0]
+ if log["action0"] != action:
+ print "eek! wrong action in filelog for %s : found %s, expected %s" % (depotPath, log["action0"], action)
+ sys.exit(1);
+
+ if not log["how0,0"].endswith(" from"):
+ print "eek! file %s was not branched but instead: %s" % (depotPath, log["how0,0"])
+ sys.exit(1);
+
+ source = log["file0,0"]
+ if source.startswith(branchPrefix):
+ continue
+
+ relPath = source[len(globalPrefix):]
+
+ for branch in knownBranches:
+ if relPath.startswith(branch):
+ gitStream.write("merge refs/heads/%s\n" % branch)
+ break
+
+ for file in files:
+ path = file["path"]
+ if not path.startswith(branchPrefix):
+ print "\nchanged files: ignoring path %s outside of branch prefix %s in change %s" % (path, branchPrefix, change)
+ continue