提交修订后,如何查看所做的更改并将其解析以征求意见? [英] How can I view the changes made after a revision is committed and parse it for comments?

查看:149
本文介绍了提交修订后,如何查看所做的更改并将其解析以征求意见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望自动化与SubVersion相关的某些任务,所以我得到了SharpSvn.不幸的是我找不到太多的文档.

I was hoping to automate some tasks related to SubVersion, so I got SharpSvn. Unfortunately I cant find much documentation for it.

我希望能够在用户提交新修订后查看更改,以便我可以解析代码以获取特殊注释,然后可以将其上载到票证系统中.

I want to be able to view the changes after a user commits a new revision so I can parse the code for special comments that can then be uploaded into my ticket system.

推荐答案

如果只想浏览SharpSvn,则可以使用 http://docs.sharpsvn.net/ .那里的文档还远远不够完整,因为重点主要在于提供功能.欢迎提供有关增强文档(或SharpSvn本身)的任何帮助;-)

If you just want to browse SharpSvn you can use http://docs.sharpsvn.net/. The documentation there is far from complete as the focus is primarily on providing features. Any help on enhancing the documentation (or SharpSvn itself) is welcome ;-)

要将日志消息用于问题跟踪器,可以使用两种路由:

To use log messages for your issue tracker you can use two routes:

  1. 一个提交后挂钩,一次处理一个更改
  2. 计划的服务,每隔一段时间调用一次"svn log -r< last-retrieved>:HEAD".

SharpSvn的最新日常构建对提交挂钩提供了一些支持,但是那部分还不是api稳定的.

The last daily builds of SharpSvn have some support for commit hooks, but that part is not really api-stable yet.

您可以使用以下方法创建后提交挂钩(post-commit.exe):

You could create a post commit hook (post-commit.exe) with:

static void Main(string[] args)
{
  SvnHookArguments ha;
  if (!SvnHookArguments.ParseHookArguments(args, SvnHookType.PostCommit, false, out ha))
  {
    Console.Error.WriteLine("Invalid arguments");
    Environment.Exit(1);
  }

  using (SvnLookClient cl = new SvnLookClient())
  {
    SvnChangeInfoEventArgs ci;
    cl.GetChangeInfo(ha.LookOrigin, out ci);

    // ci contains information on the commit e.g.
    Console.WriteLine(ci.LogMessage); // Has log message

    foreach(SvnChangeItem i in ci.ChangedPaths)
    {
       //
    }
  }
}

(对于完整的解决方案,您还必须钩住revprop-change,因为您的用户可能会在第一次提交后更改日志消息)

(For a complete solution you would also have to hook the post-revprop-change, as your users might change the log message after the first commit)

这篇关于提交修订后,如何查看所做的更改并将其解析以征求意见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆