On May 14, 2015, at 11:41 PM, RjOllos <rjo...@gmail.com> wrote:
On Thursday, May 14, 2015 at 4:20:34 PM UTC-7, Josh Santangelo wrote:My Trac setup comprises many projects supported by SimpleMultiProjectPlugin, and many repositories specified in the admin interface. I was also using the GitHub plugin, but have since moved away from GitHub and removed the plugin. Now, the results of a trac-admin env changeset command result in something like "In [changeset:"ae451ea72898091ac0fdcf74bc5aa21794f943c1/GGR"]:" being added to a ticket. I'm wondering how to get the changeset links working again, and directing to the internal source browser.The TracGit page seems to indicate that I should specify a repository_dir, but since I have many, that doesn't seem to make sense. It looks like perhaps I could define multiple repositories in a [repositories] block, but that's in 1.1+.Am I just out of luck unless I switch to the 1.1 branch of trac?Trac supports the [repositories] section since 0.12, when multi-repository support was added. That documentation section is just saying that when you specify a repository when creating an environment in Trac < 1.1.3, the configuration will be added to the [trac] section. That's the old, now deprecated single-repository way of specifying the configuration, and we really should have modified the TracAdmin initenv command back in Trac 0.12 to create the repository in the [repositories] section. In Trac 1.1.3 we removed the [trac] repository_dir option, added an upgrade step will modify trac.ini to add an equivalent repositories section and modified the initenv command to add repositories to the [repository] section of trac.ini.
So I suggest:1. give this documentation section a quick read: http://trac.edgewall.org/wiki/TracGit#AddingaGitrepositorytoanexistingenvironment2. move your configuration to the [repositories] section (not required unless you want to support multiple repositories, but might as well do it anyway)3. run ` trac-admin $env repository resync "(default)" ` (and repeat for every other repository if you have multiple repositories).I feel like I'm probably not understanding something about your configuration and why new ticket changesets links would be directing to GitHub if the plugin has been removed. You may need to modify your post-commit hook. IIRC GitHub plugin used a post-commit hook other than the Trac default one.
Good that [repositories] is supported in my version of Trac, but it’s still unclear to me what to put in there. The docs show:[repositories]
.type = git
.dir = /path/to/my/git/repository/.gitDo I just repeat .type and .dir for each repository? Is something supposed to go before the dot?
And what is the difference between [repositories] and the /admin/versioncontrol/repository page, where I already have all of my repositories entered?
I probably wasn’t very clear — my changeset links aren’t directing to GitHub — they’re directing to nothing at all. Here is a screenshot.I haven’t been using a post-commit hook, I’ve been using a script which polls my repos and calls "trac-admin env changeset added" when new commits show up. It’s sort of janky but mostly works.
On May 21, 2015, at 11:46 PM, RjOllos <rjo...@gmail.com> wrote:
On Thursday, May 21, 2015 at 2:04:18 PM UTC-7, Josh Santangelo wrote:Good that [repositories] is supported in my version of Trac, but it’s still unclear to me what to put in there. The docs show:[repositories]
.type = git
.dir = /path/to/my/git/repository/.gitDo I just repeat .type and .dir for each repository? Is something supposed to go before the dot?Yes, the repository name goes before the dot. If you omit the repository name, then you are referring to the default repository, which can also be referred to using the notation "(default)" (for example, when using trac-admin $env repository resync $repos -> trac-admin $env repository resync resync "(default)”).
And what is the difference between [repositories] and the /admin/versioncontrol/repository page, where I already have all of my repositories entered?They are different repository data stores. You can use either, or even define different repositories in each, though that's probably not recommended.I've done some work over the past few days to try and clarify the documentation. I appreciate if you can read and suggest any areas that you find confusing, redundant or lacking information:
I probably wasn’t very clear — my changeset links aren’t directing to GitHub — they’re directing to nothing at all. Here is a screenshot.I haven’t been using a post-commit hook, I’ve been using a script which polls my repos and calls "trac-admin env changeset added" when new commits show up. It’s sort of janky but mostly works.Do you have "tracopt.ticket.commit_updater.* = enabled" in your [components] section?
Gotcha. But since I’ve got the repositories configured in the database via the admin panel, specifying them in [respositories] isn’t necessary, right?
Do you have "tracopt.ticket.commit_updater.* = enabled" in your [components] section?Yes, that’s in there. My understanding is that’s what causes the commit comments to be added to the tickets. That’s working correctly, it’s just that the text in the comment doesn’t link to anything.
On May 26, 2015, at 2:56 PM, RjOllos <rjo...@gmail.com> wrote:Do you have "tracopt.ticket.commit_updater.* = enabled" in your [components] section?Yes, that’s in there. My understanding is that’s what causes the commit comments to be added to the tickets. That’s working correctly, it’s just that the text in the comment doesn’t link to anything.
Good point. With that in mind, the next things I would do are:
- Confirm there is a repository or alias named "OWW"
- Resync the repository
On May 31, 2015, at 3:14 PM, RjOllos <rjo...@gmail.com> wrote:
On Sunday, May 31, 2015 at 5:52:24 PM UTC-4, Josh Santangelo wrote:On May 26, 2015, at 2:56 PM, RjOllos <rjo...@gmail.com> wrote:Do you have "tracopt.ticket.commit_updater.* = enabled" in your [components] section?Yes, that’s in there. My understanding is that’s what causes the commit comments to be added to the tickets. That’s working correctly, it’s just that the text in the comment doesn’t link to anything.
Good point. With that in mind, the next things I would do are:
- Confirm there is a repository or alias named "OWW"
- Resync the repository/admin/versioncontrol/repository does show it:OWW (default) C:\Stimulant\Source\OWW.git [58651e6]resync:C:\Users\trac>trac-admin c:\trac\stimulant repository resync "OWW"Resyncing repository history for OWW...0 revisions cached.Done.Should that have changed anything?Yes, I think it should have cached all revisions in the repository.What are your settings for?:- [trac] default_repository_type
- [git] persistent_cache- [git] cached_repository
- [trac] repository_sync_per_request
Could you resync again with log level set to DEBUG and post the output?
2015-05-31 16:31:37,213 Trac[git_fs] DEBUG: disabled CachedRepository for 'C:\Stimulant\Source\OWW.git'
Didn’t seem to make any impact on the [changeset] tags in tickets, though.
Good thinking, yes, that was disabled according to the instructions of the GitHub plugin I had installed earlier.I probably should have just searched for changeset in the ini, or revisited those instructions to undo what I’d done before.Works now, thanks!