Skip to main content

Source code file content

Revision: 8

Return 200 instead of 404 if the project isn't found, so we don't end up disabling the hook entirely. We still log an error and return an error
» Project Revision History

» Checkout URL

javanet-webhook / repo_table.py

Size: 918 bytes, 1 line
#!/usr/bin/python2.6

repo_base = "/data/repos/java.net"

repo_table = {
    "ips": {
        "hook-test": [
            repo_base + "/ips/hook-test",
            "https://hg.java.net/hg/ips~hook-test",
            "hook-test-commits@ips.java.net"
        ],
        "javanet-webhook": [
            repo_base + "/ips/javanet-webhook",
            "https://hg.java.net/hg/ips~javanet-webhook",
            "hook-test-commits@ips.java.net"
        ],
        "pkg-gate": [
            repo_base + "/ips/pkg-gate",
            "https://hg.java.net/hg/ips~pkg-gate",
            "pkg-discuss@ips.java.net"
        ],
    },
}

if __name__ == "__main__":
        import sys

        project, feature = sys.argv[1].split("/")
        field = {
            "local": 0,
            "remote": 1,
            "mailto": 2
        }[sys.argv[2]]

        print repo_table.get(project, {}).get(feature, [None, None, None])[field]
 
 
Close
loading
Please Confirm
Close