Trac,post-receive hook,没有附加票据的提交消息

时间:2015-08-27 19:32:11

标签: git ubuntu trac

我有Ubuntu 14.04,git repo和trac 1.0安装的远程服务器。 试图使post-receive hook与trac env进行通信,将“refs #NNN”的提交消息附加到“git push”上的NNN票证。

  • 我可以手动添加评论
  • Postgresql 9.3使用
  • Repo与trac-admin一起添加
  • 推送工作正常 - 我可以看到远程仓库中的提交
  • post-receive hook可能工作正常 - 它有exec权限,它被调用并且所有trac env都属于相应的用户

    #!/bin/sh tracenv=/home/ash/trac/project_1 repos=project_1 while read oldrev newrev refname; do if [ "$oldrev" = 0000000000000000000000000000000000000000 ]; then
    git rev-list --reverse "$newrev" -- else git rev-list --reverse "$newrev" "^$oldrev" -- fi | xargs trac-admin "$tracenv" changeset added "$repos" done
    project_1=> select * from repository ; id | name | value ----+------+---------------------------------- 1 | name | project_1 1 | dir | /home/ash/projects/project_1.git 1 | type | git (3 rows)
    $ ll total 44 drwxrwxr-x 9 ash www-data 4096 авг. 27 11:02 ./ drwxrwxr-x 3 ash ash 4096 авг. 27 06:22 ../ drwxrwxr-x 2 ash www-data 4096 авг. 27 06:23 conf/ drwxrwxr-x 4 ash www-data 4096 авг. 27 06:30 deploy/ drwxrwxr-x 4 ash www-data 4096 авг. 27 12:00 .egg-cache/ drwxrwxr-x 2 ash www-data 4096 авг. 27 06:23 htdocs/ drwxrwxr-x 2 ash www-data 4096 авг. 27 06:23 log/ drwxrwxr-x 2 ash www-data 4096 авг. 27 06:23 plugins/ -rw-rw-r-- 1 ash www-data 98 авг. 27 06:23 README drwxrwxr-x 2 ash www-data 4096 авг. 27 06:23 templates/ -rw-rw-r-- 1 ash www-data 27 авг. 27 06:23 VERSION
  • trac.ini中的存储库重新同步设置为空

  • 在[components]中启用Git并提交更新程序,暂时不需要提交关闭票证:

    [components] tracopt.versioncontrol.git.* = enabled tracopt.ticket.commit_updater.* = enabled ... [ticket] ... commit_ticket_update_envelope = [] commit_ticket_update_commands.close = commit_ticket_update_commands.refs = <ALL> commit_ticket_update_check_perms = false commit_ticket_update_notify = true
  • 我启用了日志记录,没有看到任何权限(或其他)错误

    remote: 14:05:09 Trac[api] DEBUG: Event changeset_added on project_1 for changesets (u'5fa8f68ec0981f0ce17564eb93538c7778645afa',)
    remote: 14:05:09 Trac[git_fs] INFO: detected GIT version 1.9.1
    remote: 14:05:09 Trac[PyGIT] DEBUG: PyGIT.Storage instance 140213134527440 constructed
    remote: 14:05:09 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance 140213134527440 for '/home/ash/projects/project_1.git'
    remote: 14:05:09 Trac[git_fs] DEBUG: disabled CachedRepository for '/home/ash/projects/project_1.git'
    remote: 14:05:09 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for 140213134527440
    remote: 14:05:09 Trac[PyGIT] DEBUG: rebuilt commit tree db for 140213134527440 with 11 entries (took 15.1 ms)
    remote: 14:05:09 Trac[api] DEBUG: Event changeset_added on project_1 for revision 5fa8f68ec0981f0ce17564eb93538c7778645afa
  • 如果重要的话,试图推动不同的分支

  • 如果重要,还安装了TracAccountManager版本0.4.4
  • 我可以通过Admin&gt;看到提交存储库

但是承诺没有附上,你能帮我找到我的错误吗?

1 个答案:

答案 0 :(得分:0)

使用if (this.menu.createMacBuiltin) { this.menu.createMacBuiltin('Menu'); this.menuItem = this.menu.items[0]; isMac=true; } else { this.menuItem = new gui.MenuItem({label: 'Menu'}); this.menuItem.submenu = new gui.Menu(); this.menu.append(this.menuItem); } this.menuItemSubmenu = this.menuItem.submenu; ,您必须将引用括在括号中:this.newMenuItem = new gui.MenuItem({label:'New'}); this.menuItmeSubmenu.insert(this.newMenuItem,0); 。如果您不想将短语括在括号中,请从trac.ini中删除commit_ticket_update_envelope = [],或使用[refs #NNN]