def _apply_coverage_map()

in bot/code_coverage_bot/phabricator.py [0:0]


    def _apply_coverage_map(self, annotate, coverage_map):
        phab_coverage_data = ""

        for orig_changeset, orig_line in annotate:
            key = (orig_changeset, orig_line)
            if key in coverage_map:
                count = coverage_map[key]
                if count == -1:
                    # A non-executable line.
                    phab_coverage_data += "N"
                elif count > 0:
                    phab_coverage_data += "C"
                else:
                    phab_coverage_data += "U"
            else:
                # We couldn't find the original changeset-original line in the annotate data for the build changeset,
                # this means that this line has been overwritten by another changeset.
                phab_coverage_data += "X"

        return phab_coverage_data