[Trac] Re: CommitTicketUpdater with SVN help please
Thank you RjOllos, my error was simply the commit_ticket_update_envelope, I had intended to get rid of the envelope setting and was convinced I had already done so. Anyway it is working - so thank you :) I will look at trac-svn-hook as well. On Sunday, 19 July 2015 18:56:50 UTC+1, RjOllos wrote: > > On Sunday, July 19, 2015 at 4:36:06 AM UTC-7, David Cozens wrote: >> >> In /var/svn/repos/play/hooks created a file called *post-commit* with this >> content >> >> #!/bin/shexport PYTHON_EGG_CACHE="/tmp" >> /usr/bin/trac-admin /var/trac/projects/play changeset added "$1" "$2" >> >> >> In the same place created *post-revprop-change* with this content >> >> #!/bin/shexport PYTHON_EGG_CACHE="/tmp" >> /usr/bin/trac-admin /var/trac/projects/play changeset modified "$1" "$2" >> >> > Consider using trac-svn-hook since it is generally more robust. It > performs configuration error checking and creates a log in the environment > logs directory. > http://trac.edgewall.org/browser/tags/trac-0.12.5/contrib/trac-svn-hook > > >> >> I Enable the CommitTicketUpdater and CommitTicketReferenceMacro in the >> trac admin panel, and added the following to the [ticket] section of >> trac.ini. >> >> commit_ticket_update_envelope = [] >> >> commit_ticket_update_commands.close = >> >> commit_ticket_update_commands.refs = >> >> commit_ticket_update_check_perms = true >> >> commit_ticket_update_notify = true >> >> > "commit_ticket_update_envelope = []" requires that you use a message like > > Test commit hook [Refs #1]. > > If you don't want to wrap the token in an envelope, just use: > > commit_ticket_update_envelope = > -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater with SVN help please
On Sunday, July 19, 2015 at 4:36:06 AM UTC-7, David Cozens wrote: > > In /var/svn/repos/play/hooks created a file called *post-commit* with this > content > > #!/bin/shexport PYTHON_EGG_CACHE="/tmp" > /usr/bin/trac-admin /var/trac/projects/play changeset added "$1" "$2" > > > In the same place created *post-revprop-change* with this content > > #!/bin/shexport PYTHON_EGG_CACHE="/tmp" > /usr/bin/trac-admin /var/trac/projects/play changeset modified "$1" "$2" > > Consider using trac-svn-hook since it is generally more robust. It performs configuration error checking and creates a log in the environment logs directory. http://trac.edgewall.org/browser/tags/trac-0.12.5/contrib/trac-svn-hook > > I Enable the CommitTicketUpdater and CommitTicketReferenceMacro in the > trac admin panel, and added the following to the [ticket] section of > trac.ini. > > commit_ticket_update_envelope = [] > > commit_ticket_update_commands.close = > > commit_ticket_update_commands.refs = > > commit_ticket_update_check_perms = true > > commit_ticket_update_notify = true > > "commit_ticket_update_envelope = []" requires that you use a message like Test commit hook [Refs #1]. If you don't want to wrap the token in an envelope, just use: commit_ticket_update_envelope = -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater with SVN help please
I forgot to include in the post above the commit message that I am using: I am committing using svn commit -m "Test commit hook Refs #1" test.txt I have also tried svn commit -m "Test commit hook Closes #1" test.txt I see the output in the trac log in the original post, but no message is added to the ticket. The commit itself works fine. Ticket #1 is in a new state and is owned by me. Any help would be most appreciated - even if it is just to give me a clue as to which part of the process is failing. Thanks. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater with SVN help please
I missed including the commit message - fairly important svn commit -m "Test commit Refs #1" test.txt Ticket 1 is *new* and owned by me -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
Re: [Trac] Re: CommitTicketUpdater
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03.03.2015 10:14, Mo wrote: > However I'm using AnnouncerPlugin for mailing, does that conflict with > the CommitTicketUpdater? No. These are both ticket change listeners, and as such they are separate tasks, that just get triggered one after the other on ticket change. Steffen Hoffmann -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlT2FeUACgkQ31DJeiZFuHfhAgCeOOZFZSt+M40duxVRh1Bx+c9G Dx4AnjF2aaXlDjsd3yd7KpaPEloccos0 =LbsU -END PGP SIGNATURE- -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
Re: [Trac] Re: CommitTicketUpdater
On Tue, Mar 3, 2015 at 1:24 AM, Mo wrote: > ..uh wait. > > The trac project dirs and the uwsgi daemon all have uid/gid trac. > The repo is owned by root, the rebase cron-job as well. > > Doing the trac-admin changeset added manually with the right revision, the > ticket gets updated. > > So maybe the hook running as root should do a > sudo -u trac-admin ... > ? > I believe the hook script should be run by the "trac" users in your case. trac-admin will only need read-access to the repository. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater
..uh wait. The trac project dirs and the uwsgi daemon all have uid/gid trac. The repo is owned by root, the rebase cron-job as well. Doing the trac-admin changeset added manually with the right revision, the ticket gets updated. So maybe the hook running as root should do a sudo -u trac-admin ... ? -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater
Am Donnerstag, 26. Februar 2015 17:48:57 UTC+1 schrieb RjOllos: > > The [trac] repository_dir option was the pre-0.12 way of configuring > repositories that only supports a single repository. The option has been > removed in Trac 1.1.3, so you should move your repository definitions to > the [repositories] section or configure them in the database using > TracAdmin or TracWebAdmin. > > If you have a list of repositories specified for > [trac] repository_sync_per_request then syncing will occur on every > request. Better performance will be seen if you setup a post-commit hook to > sync the changeset(s) after commit. > I changed to hooks now: [trac] repository_sync_per_request = repository_type = git [ticket] commit_ticket_update_envelope = [] commit_ticket_update_commands.close = commit_ticket_update_commands.refs = commit_ticket_update_check_perms = true commit_ticket_update_notify = true As my repo gets updated via 5-minutly cron-job doing git p4 rebase I have added this hook: $ cat .git/hooks/post-receive #!/bin/sh while read oldrev newrev refname; do git rev-list --reverse $newrev ^$oldrev | \ while read rev; do trac-admin /mnt/data/trac/projects/trac-pmp/ changeset added myrepo $rev done done But committing a change with this message doesn't change anything on the ticket: [ticket #11] * Added something However I'm using AnnouncerPlugin for mailing, does that conflict with the CommitTicketUpdater? -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater
Am Donnerstag, 26. Februar 2015 17:48:57 UTC+1 schrieb RjOllos: > > The [trac] repository_dir option was the pre-0.12 way of configuring > repositories that only supports a single repository. The option has been > removed in Trac 1.1.3, so you should move your repository definitions to > the [repositories] section or configure them in the database using > TracAdmin or TracWebAdmin. > > If you have a list of repositories specified for > [trac] repository_sync_per_request then syncing will occur on every > request. Better performance will be seen if you setup a post-commit hook to > sync the changeset(s) after commit. > I changed now to post-commit hook: [trac] repository_sync_per_request = repository_type = git [ticket] commit_ticket_update_envelope = [] commit_ticket_update_commands.close = commit_ticket_update_commands.refs = commit_ticket_update_check_perms = true commit_ticket_update_notify = true As my repo gets updated via 5-minutly cron-job doing git p4 rebase I have added this hook: $ cat .git/hooks/post-receive #!/bin/sh while read oldrev newrev refname; do git rev-list --reverse $newrev ^$oldrev | \ while read rev; do trac-admin /mnt/data/trac/projects/trac-pmp/ changeset added pmp4 $rev done done But committing a change with this message doesn't change anything on the ticket: [ticket #11] * Added something However I'm using AnnouncerPlugin for mailing, does that conflict with the CommitTicketUpdater? -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater
On Thursday, February 26, 2015 at 2:08:33 AM UTC-8, Mo wrote: > > Hi, I have that same question. From bugzilla projects I remember that > triggered by some expression in the commit message, that message was added > to the ticket. > > This is trac 1.0.3 with project-plugins. > > I read > http://trac.edgewall.org/wiki/CommitTicketUpdater > > Currently I have 1 git repository configured, which is a clone of some p4 > repository synced by 5-minutly cronjob doing 'git p4 rebase': > > [trac] > repository_dir = /mnt/data/userspace/projectA > repository_sync_per_request = (default) > repository_type = git > > Now on > http://trac.edgewall.org/wiki/TracRepositoryAdmin > I see there is only the configuration via [repositories] described. What > is the difference. Is my configuration the old way, like "prior to 0.12, > Trac synchronized its cache with the repository on every HTTP request" ? > The [trac] repository_dir option was the pre-0.12 way of configuring repositories that only supports a single repository. The option has been removed in Trac 1.1.3, so you should move your repository definitions to the [repositories] section or configure them in the database using TracAdmin or TracWebAdmin. If you have a list of repositories specified for [trac] repository_sync_per_request then syncing will occur on every request. Better performance will be seen if you setup a post-commit hook to sync the changeset(s) after commit. For CommitTicketUpdater I have this configuration: > > [components] > tracopt.ticket.commit_updater.* = enabled > > [ticket] > commit_ticket_update_envelope = [] > commit_ticket_update_commands.close = > commit_ticket_update_commands.refs = > commit_ticket_update_check_perms = true > commit_ticket_update_notify = true > > But committing a change with message... > > [ticket #11] > Initial checkin > > ...does not do any change on the ticket #11. > > Does CommitTicketUpdater only work with the [repositories] configuration > and post-commit? Does this hook work with changes coming in via git p4 > rebase? > > Some question about Mercurial. There is written "Please note that at the > time of writing, no initial resynchronization or any hooks are necessary > for Mercurial repositories" but later there is a guide how to setup the > hook for Mercurial. What is correct? > > Best regards, > Massimo > -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater
Hi, I have that same question. From bugzilla projects I remember that triggered by some expression in the commit message, that message was added to the ticket. This is trac 1.0.3 with project-plugins. I read http://trac.edgewall.org/wiki/CommitTicketUpdater Currently I have 1 git repository configured, which is a clone of some p4 repository synced by 5-minutly cronjob doing 'git p4 rebase': [trac] repository_dir = /mnt/data/userspace/projectA repository_sync_per_request = (default) repository_type = git Now on http://trac.edgewall.org/wiki/TracRepositoryAdmin I see there is only the configuration via [repositories] described. What is the difference. Is my configuration the old way, like "prior to 0.12, Trac synchronized its cache with the repository on every HTTP request" ? For CommitTicketUpdater I have this configuration: [components] tracopt.ticket.commit_updater.* = enabled [ticket] commit_ticket_update_envelope = [] commit_ticket_update_commands.close = commit_ticket_update_commands.refs = commit_ticket_update_check_perms = true commit_ticket_update_notify = true But committing a change with message... [ticket #11] Initial checkin ...does not do any change on the ticket #11. Does CommitTicketUpdater only work with the [repositories] configuration and post-commit? Does this hook work with changes coming in via git p4 rebase? Some question about Mercurial. There is written "Please note that at the time of writing, no initial resynchronization or any hooks are necessary for Mercurial repositories" but later there is a guide how to setup the hook for Mercurial. What is correct? Best regards, Massimo -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: CommitTicketUpdater Question.
On Monday, August 26, 2013 12:22:17 PM UTC-7, Malcolm Frazier wrote: > Afternoon, > > I currently use the CommitTicketUpdater component to automatically set > ticket statuses, so far it has been working great. I was curious though if > it has the functionality for multiple commands such as I would like both of > these commands to work "closes #ticketnumber" and "#ticketnumber closes", I > would like both of those to close #ticketnumber. > > Thank you > You'd need to modify the regex: http://trac.edgewall.org/browser/tags/trac-1.0.1/tracopt/ticket/commit_updater.py?marks=135,147#L134 You can probably drop a file in the environment plugins directory that subclasses `CommitTicketUpdater` and modifies `ticket_re`. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/groups/opt_out.
[Trac] Re: CommitTicketUpdater does not close ticket
The real problem was the "close" thing in the config file. After changing commit_ticket_update_commands.close = "close" to commit_ticket_update_commands.close = close everything works as expected. Am Montag, 2. Juli 2012 10:00:03 UTC+2 schrieb Markus: > > I did some debugging. > The problem is that inside _get_functions(self): the cmd string gets set > to "\"close\"" instead of "close". > These additional " cause my problem. I guess the problem is caused > by Python 2.7.3rc2, used by debian wheezy. > > As a workaround i added one line > to /usr/lib/python2.7/dist-packages/tracopt/ticket/commit_updater.py : > _parse_message() > func = functions.get(cmd.lower()) > + if not func: func = functions.get("\"%s\""%cmd.lower()) > if not func and self.commands_refs.strip() == '': > > You also need to remove the commit_update.pyc file and restart apache. > > > Am Sonntag, 1. Juli 2012 00:54:48 UTC+2 schrieb RjOllos: >> >> Some otheres were reporting this issue recently. You might want to take a >> look at: >> >> https://groups.google.com/d/topic/trac-users/BV1K8shUi6U/discussion >> > -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/Zd_rlxUl4C8J. To post to this group, send email to trac-users@googlegroups.com. To unsubscribe from this group, send email to trac-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
[Trac] Re: CommitTicketUpdater does not close ticket
I did some debugging. The problem is that inside _get_functions(self): the cmd string gets set to "\"close\"" instead of "close". These additional " cause my problem. I guess the problem is caused by Python 2.7.3rc2, used by debian wheezy. As a workaround i added one line to /usr/lib/python2.7/dist-packages/tracopt/ticket/commit_updater.py : _parse_message() func = functions.get(cmd.lower()) + if not func: func = functions.get("\"%s\""%cmd.lower()) if not func and self.commands_refs.strip() == '': You also need to remove the commit_update.pyc file and restart apache. Am Sonntag, 1. Juli 2012 00:54:48 UTC+2 schrieb RjOllos: > > Some otheres were reporting this issue recently. You might want to take a > look at: > > https://groups.google.com/d/topic/trac-users/BV1K8shUi6U/discussion > -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/MrXUHZUc9SkJ. To post to this group, send email to trac-users@googlegroups.com. To unsubscribe from this group, send email to trac-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
[Trac] Re: CommitTicketUpdater does not close ticket
Some otheres were reporting this issue recently. You might want to take a look at: https://groups.google.com/d/topic/trac-users/BV1K8shUi6U/discussion -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/noe5O3PTgX0J. To post to this group, send email to trac-users@googlegroups.com. To unsubscribe from this group, send email to trac-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
[Trac] Re: CommitTicketUpdater : new command
Thanks for your response. I will try to do my own class. On 4 mai, 23:49, Remy Blank wrote: > Sandrino Torelli wrote: > > I wan't to know if it is possible to use automatic ticket modification > > like closed, ref, ... but for our private states (test, ...) without > > doing bad hack into the plugin. > > You should be able to inherit from CommitTicketUpdater in a plugin, and > add more commands. For example, to add a "move to testing" command, add > a method cmd_testing() and modify the ticket status in there, and add a > configuration option commands_testing to define words that should > trigger this command. > > Something like (untested): > > class MyUpdater(CommitTicketUpdater): > > commands_testing = Option('ticket', 'updater.testing', > 'validate test', """Words that move a ticket to testing.""") > > def cmd_testing(self, ticket, changeset, perm): > if 'TICKET_MODIFY' in perm: > ticket['status'] = 'testing' > > Then, enable your new plugin (and leave the original updater disabled). > > -- Remy > > signature.asc > < 1 000AfficherTélécharger -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to trac-us...@googlegroups.com. To unsubscribe from this group, send email to trac-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.