Skip to content

jtrussell/node-svn-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svn-info

Parse svn info.

Getting Started

Install the module with: npm install svn-info

Documentation

This module exports itself as a method you may use to asynchronously get svn info for a given path and revision:

require('svn-info')('path/to/folder/under/svn', 'HEAD', function(err, info) {
  if(err) {
    throw err;
  }
  do_something_with(info);
});

The first argument, the repo path, is optional and will default to the current working directory.

The second argument, the revision, is optional will default to 'HEAD'. Note that if you specify a revision you must also specify a path.

There's also an synchronous flavor:

var info = require('svn-info').sync('my/repo/path', 194);
do_something_with(info);

As with the async version you can optionally leave off the path and revision arguments.

NOTE: You must have the svn command line tool in your path.

NOTE The info object is in camelCased. So this:

'path': '...',
'workingCopyRootPath': '...',
'url': '...',
'relativeUrl': '...',
'repositoryRoot': '...',
'repositoryUuid': '...',
'revision': '...',
'nodeKind': '...',
'schedule': '...',
'lastChangedAuthor': '...',
'lastChangedRev': '...',
'lastChangedDate': '...'

Instead of this:

'Path': '...',
'Working Copy Root Path': '...',
'URL': '...',
'Relative URL': '...',
'Repository Root': '...',
'Repository UUID': '...',
'Revision': '...',
'Node Kind': '...',
'Schedule': '...',
'Last Changed Author': '...',
'Last Changed Rev': '...',
'Last Changed Date': '...'

Git

If you use svn via git svn the modules exports a method git you may use to asynchronously get git svn info for a given path and revision:

require('svn-info').git('path/to/folder/under/svn', 'HEAD', function (err, info) {
  if (err) {
    throw err
  }
  do_something_with(info)
})

There's also an synchronous flavor:

var info = require('svn-info').git.sync('my/repo/path', 194)
do_something_with(info)

Release History

  • v0.2.0 2014-07-11 Allow users to specify revision

License

Copyright (c) 2013 jtrussell
Licensed under the MIT license.

About

Parses and normalizes your svn info

Resources

License

Stars

Watchers

Forks

Packages

No packages published