index.js
function( wcDir, options, callback ) {
	if ( typeof options === "function" ) {
		callback = options;
		options = null;
	}
	options = options || {};
	if ( !Array.isArray( wcDir ) ) {
		wcDir = [wcDir];
	}
	var args = [ '-n' ];
	if ( options.lastChangeRevision ) {
		args.push( '-c' );
	}
	execSvnVersion( wcDir.concat( args ), options, function( err, data ) {
		var result;
		if ( !err ) {
			var match = data.match( /(\d+):?(\d*)(\w*)/ );
			if ( match ) {
				result = {};
				result.low = parseInt( match[1] );
				if ( match[2].length > 0 ) {
					result.high = parseInt( match[2] );
				} else {
					result.high = result.low;
				}
				result.flags = match[3];
				if ( result.flags.length > 0 ) {
					result.modified = result.flags.indexOf( 'M' ) >= 0;
					result.partial = result.flags.indexOf( 'P' ) >= 0;
					result.switched = result.flags.indexOf( 'S' ) >= 0;
				}
			} else {
				err = data;
			}
		}
		callback( err, result );
	} );
}
function( wcDir, options, callback ) {
	if ( typeof options === "function" ) {
		callback = options;
		options = null;
	}
	options = options || {};
	if ( !Array.isArray( wcDir ) ) {
		wcDir = [wcDir];
	}
	var args = [ '-n' ];
	if ( options.lastChangeRevision ) {
		args.push( '-c' );
	}
	execSvnVersion( wcDir.concat( args ), options, function( err, data ) {
		var result;
		if ( !err ) {
			var match = data.match( /(\d+):?(\d*)(\w*)/ );
			if ( match ) {
				result = {};
				result.low = parseInt( match[1] );
				if ( match[2].length > 0 ) {
					result.high = parseInt( match[2] );
				} else {
					result.high = result.low;
				}
				result.flags = match[3];
				if ( result.flags.length > 0 ) {
					result.modified = result.flags.indexOf( 'M' ) >= 0;
					result.partial = result.flags.indexOf( 'P' ) >= 0;
					result.switched = result.flags.indexOf( 'S' ) >= 0;
				}
			} else {
				err = data;
			}
		}
		callback( err, result );
	} );
}
function ( wcDir , options , callback ) { if ( typeof options === "function" ) { callback = options ; options = null ; } options = options || { } ; if ( ! Array . isArray ( wcDir ) ) { wcDir = [ wcDir ] ; } var args = [ '-n' ] ; if ( options . lastChangeRevision ) { args . push ( '-c' ) ; } execSvnVersion ( wcDir . concat ( args ) , options , function ( err , data ) { var result ; if ( ! err ) { var match = data . match ( / (\d+):?(\d*)(\w*) / ) ; if ( match ) { result = { } ; result . low = parseInt ( match [ 1 ] ) ; if ( match [ 2 ] . length > 0 ) { result . high = parseInt ( match [ 2 ] ) ; } else { result . high = result . low ; } result . flags = match [ 3 ] ; if ( result . flags . length > 0 ) { result . modified = result . flags . indexOf ( 'M' ) >= 0 ; result . partial = result . flags . indexOf ( 'P' ) >= 0 ; result . switched = result . flags . indexOf ( 'S' ) >= 0 ; } } else { err = data ; } } callback ( err , result ) ; } ) ; }
Gets the revision of a working copy.
@function getWorkingCopyRevision
@memberof util
@param {string} wcDir - Working copy folder
@param {object} [options] - Options object
@param {function} [callback] - Complete callback
Gets the revision of a working copy .