Mantis SVN Integration : Adding extra info to the Note

2023-05-16

http://blog.crazytje.be/mantis-svn-integration-adding-extra-info-to-the-note/



In my previous post I talked about Mantis and SVN integration.

One thing I was missing that I used to have is more control over the message(note) that gets posted.

The source control plug-in supports the following arguments:

  • $1 for branch
  • $2 for revision
  • $3 for timestamp
  • $4 for commit message
  • $5 for repository name
  • $6 for changeset ID

An example what message you can make:


Revision: $2 in repository: $5<br /> On: $3 <br />Message:<br /> $4  

Results in:


Revision: 484 in repository MyRepo
On: 2011-08-14 18:15

Message:
fixed issue 243: war was fixed, we have world peace!  

This wasn’t what I wanted, the output I had in the previous mantis version was like this:


Revision: 484
Commit by: Crazy

Message:
fixed issue 243: war was fixed, we have world peace!

Changes:
M    /trunk/war_ annihiliator.php  

 

Two parameters are missing to get this result, those are:

  • $7 for author
  • $8 for the changes.

After diving in the source, it was fairly easy to add this functionality

All the data was already there. I assume it wasn’t added because when working with git it doesn’t have this info.

Here is the patch that you need to apply to get the 2 extra parameters:


diff -crB ./Source/Source.API.php ./Source/Source.API.php
*** ./Source/Source.API.php    2011-08-03 14:50:07.000000000 -0500
--- ./Source/Source.API.php    2011-08-14 14:48:04.000000000 -0500
***************
*** 288,295 ****
$t_resolution = config_get( 'plugin_Source_bugfix_resolution' );
$t_handler = config_get( 'plugin_Source_bugfix_handler' );
$t_message_template = str_replace(
!         array( '$1', '$2', '$3', '$4', '$5', '$6' ),
!         array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s', '%6$s' ),
config_get( 'plugin_Source_bugfix_message' ) );
 
$t_mappings = array();
--- 288,295 ----
$t_resolution = config_get( 'plugin_Source_bugfix_resolution' );
$t_handler = config_get( 'plugin_Source_bugfix_handler' );
$t_message_template = str_replace(
!         array( '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8' ),
!         array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s'),
config_get( 'plugin_Source_bugfix_message' ) );
 
$t_mappings = array();
***************
*** 340,346 ****
 
# generate a note message
if ( $t_enable_message ) {
!             $t_message = sprintf( $t_message_template, $t_changeset-&gt;branch, $t_changeset-&gt;revision, $t_changeset-&gt;timestamp, $t_changeset-&gt;message, $t_repos[ t_changeset-&gt;repo_id ]-&gt;name, $t_changeset-&gt;id );
} else {
$t_message = '';
}
--- 340,357 ----
 
# generate a note message
if ( $t_enable_message ) {
! $changelog = "";
! foreach($t_changeset-&gt;files as $file) {
! switch($file-&gt;action) {
! case 'add': $changelog.='A'; break;
! case 'rm' : $changelog.='D'; break;
! case 'mod': $changelog.='M'; break;
! case 'mv' : $changelog.='R'; break;
! default : $changelog.='C'; break;
! }
! $changelog.="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;".$file-&gt;filename.'&lt;br/&gt;';
! }
!             $t_message = sprintf( $t_message_template, $t_changeset-&gt;branch, $t_changeset-&gt;revision, $t_changeset-&gt;timestamp, $t_changeset-&gt;message, $t_repos[ t_changeset-&gt;repo_id ]-&gt;name, $t_changeset-&gt;id, $t_changeset-&gt;author, $changelog );
} else {
$t_message = '';
}  

In the patch above I left out the changes in the language files. Here is a complete version that has the language file updates as well:
Mantis Source Control Patch

To apply the patch, run the following command:


cd /mymantispath/plugins/
echo "Do a dry run first to see if it works"
patch --dry-run -p1 -i mantis.patch
echo "Now apply it for real"
patch -p1 -i mantis.patch  

 

After applying the patch in the zip the text will have changed on the configuration page for ‘source control’.

It will now include the $7(author) and $8(modifications) parameters.

 

The message template I’m using is:


Revision: $2 <br /> Commit by: $7 <br /> <br /> Message:<br /> $4<br /> <br /> Changes:<br /> $8<br />  

This gives the following output:


Revision: 484
Commit by: Crazy

Message:
fixed issue 243: war was fixed, we have world peace!

Changes:
M    /trunk/war_ annihiliator.php  

 

Be aware that this hasn’t been tested with Github. Most people only use 1 source control system, but those that mix, test this first!


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Mantis SVN Integration : Adding extra info to the Note 的相关文章

  • 如何将svn中的代码编译成jar文件?

    我发现 HTMLUnit 对我很有用 但文件太旧了 所以我用svn co https htmlunit svn sourceforge net svnroot htmlunit https htmlunit svn sourceforge
  • 你已经从颠覆转向善变了吗?值得付出努力吗?

    我正在更好地了解 Mercurial 版本控制系统 并且正在考虑从 SVN 进行转换 有人已经转换了吗 对于您和您的团队来说 转变是否困难 您能否给出一些建议 是继续使用 SVN 还是选择 Mercurial 一旦开始 你就永远不想回去 优
  • 关于如何处理涉及 API 集成的项目的想法

    我是一名学生 正在开发一个 Java 应用程序 该应用程序将充当一个应用程序的 Web 服务调用与另一个应用程序的 JMX API 之间的 转换层 这两个应用程序驻留在同一网络中的两个不同系统上 因此 本质上 它涉及一个可交付程序 该程序将
  • DropBox Mac 客户端如何工作?

    我一直在看DropBox http www getdropbox com install os macMac 客户端和我目前正在研究为不同的服务实现类似的界面 他们究竟是如何与这样的取景器交互的 我非常怀疑文件夹中表示的这些对象是每次加载时
  • 如何避免子文件夹上的 svn:mergeinfos ?

    我们尝试仅将 svn mergeinfo 属性保留在根分支文件夹上 然而 我们不断看到它渗入子文件夹中 我们已经能够确定一些可能的原因 在存储库浏览器中移动文件夹 在 IntelliJ 中移动和 或重命名包 使用旧的 svn 客户端 任何人
  • svn 可以提供哪些报告?

    我们正在迁移到 SVN 对我们来说不幸的是 我们会定期接受审核 审核员需要以下信息 文件更改历史记录SVN访问历史添加了新文件文件的变化 是否有一个工具可以为我们生成这些报告 或其中一些报告 StatSVN是一个轻量级的颠覆报告生成器 ht
  • 无法连接到 Subversion 本地存储库

    我已在 Windows 7 64 位上安装了 Subversion 1 8 8 和 TortoiseSVN 1 8 5 64 位 我使用 TortoiseSVN 在 C Projects SVNRepository 创建了一个本地存储库 在
  • 将非标准 svn 转换为 git

    我们有一个非标准的 svn 设置 如下所示 Root gt Trunk gt Projects gt Project 1 gt Project 2 gt Project 3 gt Libraries gt Library 1 gt Libr
  • AnkhSVN 和 VisualSVN 可以同时使用吗?

    我想尝试 AnkhSVN 的一项功能 即与 Red Gate SQL Changeset 工具集成 而无需完全卸载 VisualSVN 这感觉很危险 所以我想看看其他人是否有经验可以减轻或证实我的恐惧 Update所以我尝试卸载 Visua
  • `git svn rebase` 与 `git rebase trunk`

    我正在开发一个使用 subversion 作为存储库的项目 因为我需要进行一些还无法发送到 svn 服务器的更改 所以我开始使用git svn这样我就可以进行本地签到 我的设置如下所示 分支机构 trunk 跟踪 svn trunk mas
  • 使用登录名签出 svn+ssh

    我想从存储库中签出一些内容 但是我输入 svn co svn ssh URL 我被要求输入密码 我想他使用的用户名来自我的控制台 但两者不一样 那么我如何使用不同的登录名使用 svn ssh 签出某些内容呢 SSH 允许您在连接 URL 中
  • 用于 Tortoise 客户端的 Windows Subversion 服务器 (SVN)

    我的问题是这样的 在 Windows 上使用的 Subversion Server https stackoverflow com questions 615866 subversion server to use on windows 唯
  • 对于单个开发人员来说,是否值得从 SVN 转向 Git?

    自 2013 年起 此线程很可能已过时 当存储库主要由单个开发人员访问时 是否值得从 SVN 转到 GIT 我有几台用于开发的机器 主要不是用 C 开发 但我的存储库中混合了 VB VB Net PHP C C HTML Batch BAS
  • SQL Server Management Studio 2005 或 2008 是否有 SVN 插件? [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 正在寻找一个 源代码控制 插件来将 SSMS 与 Subversion SVN 集成 有人知道其中一个吗 Redgate 的解决方案似乎是
  • 用于阻止大于 20MB 的提交的预提交挂钩

    是否可以为 SVN 1 8 编写 prcommit 挂钩以避免提交大于 20MB 的文件 任何建议 将不胜感激 谢谢 我尝试过 但这不适用于二进制文件或其他文件扩展名 filesize SVNLOOK cat t TXN REPOS f w
  • SVN存储库内容

    我已经设置了 VisualSvn Server 创建了一个存储库 并使用 AnkhSVN 向其中添加了 Visual Studio 解决方案 存储库的 url 类似于https msi pc svn MyProj 由于我的无能 一个问题 此
  • Eclipse、Subclipse 1.8.2、SVN 1.7.0 每次操作都要求输入密码

    我安装新的后日食靛蓝 它会要求我输入密码SVN存储库透视图 例如 浏览每个文件夹并再次询问密码 正常使用SVNKit 它要求输入密码每次会话一次 SVNKit 不支持SVN 1 7 0 yet 我该如何解决这个问题 或者这是 JavaHL
  • git 存储库中的提交次数

    我的一个为期 5 个月的项目即将结束 作为毫无意义的统计数据的粉丝 我想知道自存储库启动以来已经进行了多少次提交 我怎样才能发现这一点 Notes 我知道没有one存储库 我只对本地版本感兴趣 这在颠覆中是微不足道的 因为修订标识符 似乎是
  • 以最小的努力在多台计算机之间同步代码

    我希望能够跨多台计算机 准确地说是 3 台 同步源代码和整个项目 我尝试过使用 git 但从来没有获得过无忧无虑的体验 也许是因为我从来没有投入很多精力 所以 我理想中想要的是 能够将文件夹及其所有子文件夹添加到 同步 列表 基本上 一旦我
  • 通过 Git/SVN 将前缀 ? 添加到代码中

    怎么加前缀 v VersionNumber使用 Git SVN 高效地访问存储库中的每个文件 我发现 SO 使用这种做法为其存储库中的每个特定文件提供版本号 他们使用SVN 我想知道如何使用 Git 做同样的事情 举几个例子 1 2 在你的

随机推荐

  • MySQL慢查询的两种分析方案 slow sql

    http blog csdn net ylqmf article details 6541542 前一段日子 xff0c 我曾经设置了一次记录在MySQL数据库中对慢于1秒钟的SQL语句进行查询 想起来有几个十分设置的方法 xff0c 有几
  • 如何使用SQL Profiler 性能分析器

    http blog csdn net ylqmf article details 6541625 ysql 的 sql 性能分析器主要用途是显示 sql 执行的整个过程中各项资源的使用情况 分析器可以更好的展示出不良 SQL 的性能问题所在
  • magento中生成https链接的简单方法

    有关magento中https的基础知识 xff0c 请看 magento中的启用https 如果是在项目的后期才决定采用https xff0c 那么就要面临一个问题 xff1a 大量的生成url的代码需要修改 xff0c 这是一个很大的工
  • 树莓派无屏幕连接WiFi

    将刷好 Raspbian 系统的 SD 卡用电脑读取 在 boot 分区 xff0c 也就是树莓派的 boot 目录下新建 wpa supplicant conf 文件 xff0c 按照下面的参考格式填入内容并保存 wpa supplica
  • MySQL数据库存储引擎MyISAM和InnoDB的对比详解

    http www mysqlops com 2011 12 09 myisam E5 92 8Cinnodb E5 AF B9 E6 AF 94 E8 AF A6 E8 A7 A3 html 之前Eugene兄已经写过两篇关于myisam转
  • 为什么magento的rewrite方法对抽象类无效

    magento中 xff0c 是没法通过Mage getModel 34 xx xx 34 配合xml中的 lt rewrite gt 实现abstruct class的rewrite 为什么 xff1f 这需要详细了解一下magento中
  • magento中在.htaccess设置website code

    在 htaccess中 xff0c 添加以下的内容 xff1a SetEnvIf Host www newjueqi com MAGE RUN CODE 61 newjueqi SetEnvIf Host www newjueqi com
  • apache两种工作模式详解

    http blog chinaunix net space php uid 61 20541969 amp do 61 blog amp id 61 351485 刚接触这两个配置时很迷糊 xff0c 全部开启或全部注释没有几多变化 今天搜
  • Apache处理http请求的生命周期

    Apache请求处理循环详解 Apache请求处理循环的11个阶段都做了哪些事情呢 xff1f 1 Post Read Request阶段 在正常请求处理流程中 xff0c 这是模块可以插入钩子的第一个阶段 对于那些想很早进入处理请求的模块
  • 提高MySQL插入记录的速度

    http hi baidu com jackbillow blog item 65ea47248f645521d50742e7 html 在myisam engine下 1 尽量使用insert into table name values
  • 最常用的http状态码

    200 OK 找到了该资源 xff0c 并且一切正常 202 Accepted 服务器已接受请求 xff0c 但尚未处理 amp bsp 301 Moved Permanently 被请求的资源已永久移动到新位置 302 Found 请求的
  • shell中通过ftp批量上传文件

    为了在shell中上传文件 xff0c 需要避免在控制台中通过交互的方式输入ftp的登录密码 xff0c 这时要安装一个强大的ftp命令行工具 xff1a lftp xff0c 通过lftp登录ftp服务器的格式如下 xff1a lftp
  • 你可能不了解的strtotime函数

    出处 xff1a http www phppan com 2011 06 php strtotime 作者 xff1a 胖胖 在前面的文章中 xff0c 我们提到strtotime函数在使用strtotime 1 month 求上一个月的今
  • PHP的词法解析器:re2c

    出处 xff1a http www phppan com 2011 09 php lexical re2c 作者 xff1a 胖胖 re2c是一个扫描器制作工具 xff0c 可以创建非常快速灵活的扫描器 它可以产生高效代码 xff0c 基于
  • 由浅入深探究mysql索引结构原理、性能分析与优化

    出处 xff1a http www phpben com post 61 74 摘要 xff1a 第一部分 xff1a 基础知识 第二部分 xff1a MYISAM 和 INNODB 索引结构 1 简单介绍 B tree B 43 tree
  • php的strtotime函数源码分析

    最近想实现一个多语言版的strtotime函数 xff0c 所以阅读了php源码中strtotime函数的实现 xff0c 很感谢 胖胖 大大的文章 xff08 http www phppan com 2011 06 php strtoti
  • 新浪微博,腾讯微博mysql数据库主表猜想

    出处 http blog csdn net cleanfield article details 6339428 注意 xff0c 原文下面的评论也是难得的学习资料 xff0c 千万不能错过 用户信息表 xff08 t user info
  • linux shell 常见的时间戳操作

    获取当前的时间戳 span class hljs keyword date span 43 span class hljs variable s span 获取某个时间点的时间戳 span class hljs keyword date s
  • Mantis: SVN integration in 1.2.x

    http blog crazytje be mantis svn integration in the 1 2 x Recently I upgrade my mantis version from 1 1 8 to 1 2 6 first
  • Mantis SVN Integration : Adding extra info to the Note

    http blog crazytje be mantis svn integration adding extra info to the note In my previous post I talked about Mantis and