How to access the current Subversion build number?

前端 未结 16 2150
刺人心
刺人心 2020-11-27 05:43

How can you automatically import the latest build/revision number in subversion?

The goal would be to have that number visible on your webpage footer like SO does.

16条回答
  •  余生分开走
    2020-11-27 06:02

    Using c# and SharpSvn (from http://sharpsvn.net) the code would be:

    //using SharpSvn;
    long revision = -1;
    using(SvnClient client = new SvnClient())
    {
      client.Info(path,
        delegate(object sender, SvnInfoEventArgs e)
        {
           revision = e.Revision;
        });
    }
    

提交回复
热议问题