This procedure is defined in the server but not documented via ad_proc or proc_doc and may be intended as a private interface.

The procedure is defined as:

proc ::nsmcp::codeUpstreamMapping {path mappings} {
    
    codeUpstreamPath $path
    set selected {}
    set longest -1
    foreach mapping $mappings {
        foreach key {localPrefix repository upstreamPrefix ref} {
            if {![dict exists $mapping $key]} {
                error "invalid-upstream-mapping"
            }
        }
        set prefix [codeUpstreamPath [dict get $mapping localPrefix]]
        if {[string index $prefix end] ne "/"} {
            error "upstream-local-prefix-must-end-in-slash"
        }
        set repo [dict get $mapping repository]
        if {![regexp {^[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*$} $repo]} {
            error "invalid-upstream-repository"
        }
        set remote [codeUpstreamPath [dict get $mapping upstreamPrefix] true]
        if {$remote ne {} && [string index $remote end] ne "/"} {
            error "upstream-prefix-must-end-in-slash"
        }
        codeUpstreamRef [dict get $mapping ref]
        if {[dict exists $mapping baselineRef] && [dict get $mapping baselineRef] ne {}} {
            codeUpstreamRef [dict get $mapping baselineRef]
        }
        if {[string first $prefix $path]==0 && [string length $prefix]>$longest} {
            set selected $mapping
            set longest [string length $prefix]
            dict set selected path $remote[string range $path $longest end]
        }
    }
    if {$selected eq {}} {
        error "upstream-mapping-not-configured"
    }
    codeUpstreamPath [dict get $selected path]
    return $selected

}

Show another procedure: