All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lib.xp.examples.node.getCommit.js Maven / Gradle / Ivy

The newest version!
var nodeLib = require('/lib/xp/node');
var assert = require('/lib/xp/testing');

/* global log */

var repo = nodeLib.connect({
    repoId: 'cms-repo',
    branch: 'draft'
});

// BEGIN
// Commits a node.
var commit = repo.commit({
    keys: ['nodeId'],
    message: 'Commit message'
});
// END

// BEGIN
// Get commit.
var result = repo.getCommit({
    id: commit.id
});

log.info('Commit created with id ' + result._id);
// END


assert.assertJsonEquals(commit, result);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy