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 的相关文章

  • ASP.NET 显示 SVN 修订号

    我在 Stack Overflow 页脚中看到显示了 SVN 修订号 这是自动化的吗 如果是的话 如何在 ASP NET 中实现它 其他语言的解决方案也是可以接受的 确保该文件有 svn keywords Rev Id 然后把 Rev 在那
  • 找不到 cygwin setup.exe 文件?

    我正在尝试将 subversion 数据包添加到 cygwin 为此我需要运行 setup exe 但我在 cygwin 文件夹中找不到它 它会位于哪里 它不是incygwin 文件夹 它位于您上次安装时放置的位置 很可能是垃圾箱或临时目录
  • 通过 SVN 从 Jenkins 更新工作区时出现间歇性“SVNException:svn:E175002:连接重置”

    我有 Jenkins 2 138 3 在虚拟机上运行 在同一网络上的另一台 PC 上 我有一个 Visual SVN 服务器 3 9 2 结帐间歇性地 可能是 25 的时间 失败 并出现以下错误 ERROR Failed to check
  • Subversion 中的版本和项目的良好存储库布局是什么? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 我们有标准的 Subversion 主干 分支 标签布局 我们有几个针对中长期项目的分支 但到目前为止还没有一个发布版本 这正在快速逼近 我们应
  • 对于独立开发人员来说,通过 file:// 访问 Subversion 存储库有什么缺点吗?

    如果您的开发计算机上安装了 Subversion 并且您不在团队中工作 那么您是否有任何理由应该使用 Subversionsvn协议而不是file 如果您自己在一台机器上工作 那么根据我的经验 使用 file 协议效果很好 即使我的团队在远
  • Tortoise 无法连接到 subversion 服务器

    我正在尝试在我的家庭服务器上设置 Subversion 存储库 经过一些更改后 我在 Windows Server 2003 服务器上卸载并重新安装了 VisualSVN Server 并且存储库的地址 即 URL 是https serve
  • git svn 克隆特定分支并合并

    我希望将我的代码库从 svn 迁移到 git 我的 svn 仓库中有太多分支 我只想克隆几个分支并将它们合并在一起并将其推送到 git 我想避免克隆所有分支 因为这需要很长时间 我该如何实现这一目标 完成后 我想定期从这些 svn 分支获取
  • SVN 不断提示我输入密码并拒绝缓存我的凭据

    环境 Eclipse Indigo Ubuntu 11 04 Subclipse 1 6 SVN 客户端 Subclipse RabbitVCS 我通过 svn ssh 连接 我的网址如下所示 svn ssh 我的名字 我的域名 路径 我可
  • Android:在surfaceview上实现admob

    我有一个使用 SurfaceView 的小游戏形式的活动 下面是代码片段 我很困惑如何在 SurfaceView 上实现 admob 请建议 public class DroidzActivity extends Activity priv
  • 如何修复损坏的本地 Subversion 工作副本?

    我通常使用 git 对 Subversion 的基础知识知之甚少 所以请保持温柔 我在 Windows 7 上使用 TortoiseSVN SVN 客户端最近宣布需要升级 所以我就这么做了 所有文件都丢失了源代码管理图标 并且资源管理器中出
  • 在 Windows 上使用的 Subversion Server

    哪种 Subversion SVN Server 会建议新手开始使用 Windows Server 操作系统 我想我将在客户端上使用 TortoiseSVN 并且主要进行 NET 开发 UPDATE 很好的建议 我根据投票选择我的答案 我会
  • 如何在Windows控制台中递归使用“svn add”?

    当我跑步时 svn st 在我的工作副本上我得到一些 位于工作副本根目录的子目录中的条目 我想将它们全部添加到存储库中 我尝试 svn add force and svn add force 但它不起作用 工作方案 svn add dept
  • 使用 svn_access_file 中的 LDAP 组设置 Subversion 存储库

    如果我从头开始这样做 我会创建这两个单独的存储库 不幸的是 我不得不凑合着用现有的东西 我们的存储库如下所示 trunk tags branches secret trunk secret tags secret branches 我的 S
  • 使用 teamcity 在 svn 中自动分支

    我想知道是否可以使用 Teamcity 进行自动分支 目前 我使用 web 部署自动发布 Web 应用程序 唯一剩下的就是分支 因为我们通常在 svn 中创建一个分支 然后发布下一个版本 任何人都可以建议是否可能以及如何做 打开您的发布版本
  • scala sbt 在多项目上测试运行设置和清理命令一次

    我知道我可以通过修改 testOptions 在 sbt 中添加设置和清理代码以用于测试阶段 例如 val embedMongoTestSettings Seq Setting Seq testOptions in Test Tests S
  • tmatesoft.svn.core.SVNAuthenticationException:svn:E170001

    我们正在一个遗留项目 maven 中工作来设置devop 詹金斯首发 Jenkins 构建现在没有问题 但是 在将 sonarqube 与 jenkins 集成时 我们收到以下错误 ERROR Error during SonarQube
  • git-svn SVN 作者文件的相对路径?

    我已经使用 git svn 从工作中克隆了一个 SVN 存储库 在最初的克隆过程中 我提供了一个 SVN 作者文件 当我进行初始克隆时 git 设置了authorsfile作为绝对路径 但是 我在工作机器和笔记本电脑上保留了这个 git 存
  • 制作 svn 存储库的独立副本

    我正在尝试克隆存储库 但它应该是彼此独立的副本 这背后有什么魔力吗 或者只是使用 svn 客户端并克隆它 Thanks Try svnadmin hotcopy http svnbook red bean com en 1 8 svn re
  • SVN 提交前撤消删除

    如果您从 SVN 工作副本中删除了一个目录 但尚未提交 则如何将其恢复并不明显 当您输入 svn undo d 时 Google 甚至建议将 svn undo delete before commit 作为常见查询 但搜索结果没有任何帮助
  • 递归删除属性

    Tortoise SVN 可以选择递归地将属性应用于所有子文件夹 子文件 现在我需要删除这个属性 我怎样才能递归地做到这一点 我没有找到如何使用 GUI 递归删除属性 但您可以使用 svn 命令行工具删除属性 svn propdel PRO

随机推荐

  • 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