src/common/storage/storageclasses/editorstorage.js
function extractSWMContext(swmParams) {
            var result = {};

            if (swmParams.projectId) {
                result.projectId = swmParams.projectId;
                if (swmParams.branchName || swmParams.branch || swmParams.commitHash || swmParams.commit) {
                    // Add any of these.
                    result.branchName = swmParams.branchName || swmParams.branch;
                    result.commitHash = swmParams.commitHash || swmParams.commit;
                }
            } else if (swmParams.context &&
                swmParams.context.managerConfig &&
                swmParams.context.managerConfig.project) {
                // This is a plugin request..
                result.projectId = swmParams.context.managerConfig.project;
                result.commitHash = swmParams.context.managerConfig.commitHash;
                result.branchName = swmParams.context.managerConfig.branchName;
            }

            return result;
        }
function extractSWMContext(swmParams) {
            var result = {};

            if (swmParams.projectId) {
                result.projectId = swmParams.projectId;
                if (swmParams.branchName || swmParams.branch || swmParams.commitHash || swmParams.commit) {
                    // Add any of these.
                    result.branchName = swmParams.branchName || swmParams.branch;
                    result.commitHash = swmParams.commitHash || swmParams.commit;
                }
            } else if (swmParams.context &&
                swmParams.context.managerConfig &&
                swmParams.context.managerConfig.project) {
                // This is a plugin request..
                result.projectId = swmParams.context.managerConfig.project;
                result.commitHash = swmParams.context.managerConfig.commitHash;
                result.branchName = swmParams.context.managerConfig.branchName;
            }

            return result;
        }
function extractSWMContext ( swmParams ) { var result = { } ; if ( swmParams . projectId ) { result . projectId = swmParams . projectId ; if ( swmParams . branchName || swmParams . branch || swmParams . commitHash || swmParams . commit ) { // Add any of these. result . branchName = swmParams . branchName || swmParams . branch ; result . commitHash = swmParams . commitHash || swmParams . commit ; } } else if ( swmParams . context && swmParams . context . managerConfig && swmParams . context . managerConfig . project ) { // This is a plugin request.. result . projectId = swmParams . context . managerConfig . project ; result . commitHash = swmParams . context . managerConfig . commitHash ; result . branchName = swmParams . context . managerConfig . branchName ; } return result ; }
Dig out the context for the server-worker request. Needed to determine if
the request needs be queued on the current commit-queue.
@param {object} swmParams
@returns {object} If the request contains a projectId and (branchName and/or commitHash). It
will return an object with projectId and (branchName and/or commitHash).
Dig out the context for the server - worker request . Needed to determine if the request needs be queued on the current commit - queue .