index.js
function( target, options, callback ) {
	if ( typeof options === "function" ) {
		callback = options;
		options = null;
	}
	options = options || {};
	info( target, options, function( err, data ) {
		var rev;
		if ( !err ) {
			var revString;
			if ( options.lastChangeRevision ) {
				if ( data && data.entry && data.entry.commit && data.entry.commit.$ && data.entry.commit.$.revision ) {
					revString = data.entry.commit.$.revision;
				}
			} else {
				if ( data && data.entry && data.entry.$ && data.entry.$.revision ) {
					revString = data.entry.$.revision;
				}
			}
			if ( revString !== undefined ) {
				try {
					rev = parseInt( revString, 10 );
				}
				catch ( err3 ) {
					err = 'Invalid revision value [' + revString + ']';
				}
			} else {
				err = 'Could not parse info result to get revision [' + JSON.stringify( data ) + ']';
			}
		}
		callback( err, rev );
	} );
}
function( target, options, callback ) {
	if ( typeof options === "function" ) {
		callback = options;
		options = null;
	}
	options = options || {};
	info( target, options, function( err, data ) {
		var rev;
		if ( !err ) {
			var revString;
			if ( options.lastChangeRevision ) {
				if ( data && data.entry && data.entry.commit && data.entry.commit.$ && data.entry.commit.$.revision ) {
					revString = data.entry.commit.$.revision;
				}
			} else {
				if ( data && data.entry && data.entry.$ && data.entry.$.revision ) {
					revString = data.entry.$.revision;
				}
			}
			if ( revString !== undefined ) {
				try {
					rev = parseInt( revString, 10 );
				}
				catch ( err3 ) {
					err = 'Invalid revision value [' + revString + ']';
				}
			} else {
				err = 'Could not parse info result to get revision [' + JSON.stringify( data ) + ']';
			}
		}
		callback( err, rev );
	} );
}
function ( target , options , callback ) { if ( typeof options === "function" ) { callback = options ; options = null ; } options = options || { } ; info ( target , options , function ( err , data ) { var rev ; if ( ! err ) { var revString ; if ( options . lastChangeRevision ) { if ( data && data . entry && data . entry . commit && data . entry . commit . $ && data . entry . commit . $ . revision ) { revString = data . entry . commit . $ . revision ; } } else { if ( data && data . entry && data . entry . $ && data . entry . $ . revision ) { revString = data . entry . $ . revision ; } } if ( revString !== undefined ) { try { rev = parseInt ( revString , 10 ) ; } catch ( err3 ) { err = 'Invalid revision value [' + revString + ']' ; } } else { err = 'Could not parse info result to get revision [' + JSON . stringify ( data ) + ']' ; } } callback ( err , rev ) ; } ) ; }
'lastChangeRevision' option returns the last commit revision, instead of the working copy revision Gets head revision of a given URL
@function getRevision
@memberof util
@param {string} target - Target URL
@param {object} [options] - Options object
@param {function} [callback] - Complete callback
lastChangeRevision option returns the last commit revision instead of the working copy revision Gets head revision of a given URL