thomfang / svnjs

A javascript lib use as a SVN client on web.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svnjs

A javascript lib use as a SVN client on web.

Introduce

The lib supports follow SVN operations:

  • svn add
  • svn rm (del, remove, delete)
  • svn mkdir
  • svn ps (propset, pset)
  • svn pd (propdel, pdel)
  • svn ci (commit)

Quick Start

  1. Generate an instance:

    var mysvn = new svnjs.Client(usname, passwd, basepath);
    
  2. Then do what you can & what you want, like:

    mysvn.mkdir('my_dir');
    mysvn.add('test.js', 'alert("done!");');
    mysvn.propset('test.js', { 'mime-type': 'text/javscript' });
    
  3. The most important step:

     mysvn.commit("Create a folder:my_dir and add a js file:test.js")  	
    	.done(function () {console.log("done")})
    	.fail(function () {console.log("fail")});
    

    If you do everything without this step, The request won't be sent.


API

name param type description
add

file

content

string

string

the file to add

text write into the file

del path string a file or a directory
propset

file

prop_json

string

json

target file to set props

props to set

propdel

file

prop_array

string

array

target file to del props

props to del

mkdir dir_name string directory name
commit

summary

success_callback

fail_callback

string

function

function

commit summary

function callback after all requests success

function callback when request fail

Future will continue to support more operation command, like move, copy, lock, unlock.

About

A javascript lib use as a SVN client on web.


Languages

Language:JavaScript 94.4%Language:HTML 5.6%