How to use Node to get svn user information and nodesvn user information
How to use Node to get svn user information
Currently, we still use svn for version control. Sometimes we need to monitor a person's code, while svn username is the best user tag.
So how do we get some svn information?
Assume that you are usingmac
As a development machine.
Below, I provide some code.
/*** [Obtain user information through svn] * @ param {[type]} host [svn repository host address, for example, 192.168.1.1: 80] * @ param {Function} cb [callback after obtaining] */var getUserInfo = function (host, cb) {var cmd = 'CD ~ /. Subversion/auth/svn. simple/& ls | xargs cat $1 'child_process.exec (cmd, function (err, data) {var fragment = data. split (host) [1]; fragment. replace (/username \ n. + \ n (\ w +) \ n/, function () {cb & cb (arguments [1]) ;});}
The Code is a little simple, but in node as the development environment and svn as the version control, this method has been tried and tested.
If windows is used as the development machineSub-Process Method
Yes. However, you can usefs
.
If there is time later, I willsvn
Open-source tools to solve some code building problems.
However, there are currently fewer and fewer companies using svn. In addition to some older and important code that is still in svn, others have switched to git.
Let's continue with git.
You can see my blog http://hirra.cn/2015/01/03/node at present there are not many, but will be slowly added in the future.