Modify

Opened 4 years ago

Closed 4 years ago

Last modified 15 months ago

#6554 closed enhancement (fixed)

[patch] Add Trac 0.12 support

Reported by: kevin.mcconnell@… Owned by: hvr
Priority: normal Component: GitPlugin
Severity: normal Keywords:
Cc: tolsen, lkraav, peter@… Trac Release: 0.12

Description

Attached is a patch to make the plugin work in 0.12, as mentioned in #1040. It updates the code to match the recent API changes in Trac:MultiRepos, and also makes abbreviated SHA-1's work in Trac:TracLinks.

You'll need to make the 0.12 branch first (svn cp 0.11 0.12) before applying this. I wasn't sure if there was a way to include that in the patch itself. It seems that Git has pushed all the SVN knowledge out of my brain :)

Also, it currently only works if cached_repository is disabled; not sure why at the moment. But the rest of it seems to be working.

Attachments (2)

gitplugin-0.12.diff (9.1 KB) - added by kevin.mcconnell@… 4 years ago.
changes for Trac 0.12
gitplugin-0.12.v2.diff (9.7 KB) - added by kevin.mcconnell@… 4 years ago.
updated to include cached_repository support

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by kevin.mcconnell@…

changes for Trac 0.12

Changed 4 years ago by kevin.mcconnell@…

updated to include cached_repository support

comment:1 Changed 4 years ago by kevin.mcconnell@…

Added revised patch (gitplugin-0.12.v2.diff). It now also works when cached_repository=true.

comment:2 Changed 4 years ago by lkraav

is this the same thing as http://github.com/lentil/trac-git-plugin?

comment:3 Changed 4 years ago by lkraav

  • Cc lkraav added

comment:4 Changed 4 years ago by hvr

(In [7695]) created 0.12/ branch, tweaked setup.py, and applied patch by kevin.mcconnell@… (see #6554)

comment:5 Changed 4 years ago by irrshade

Does this patch still work with cached_repository enabled? I'm running a copy of Trac I checked out last night and it appears to have problems when cached_repository is on. (Seems related to a change made to Trac a few days ago to pad changeset numbers to ten digits).

I didn't have any luck figuring out a fix.

comment:6 Changed 4 years ago by irrshade

And of course I should have read the tickets on Trac before posting-- caching appears to have been fixed again for non-SVN repos in the latest HEAD for Trac.

comment:7 Changed 4 years ago by lkraav

re comment:6, for anyone else running into breakage, trac:#9089 -> trac:r9280 fixed git for me.

comment:8 follow-up: Changed 4 years ago by andy.czerwonka@…

If I do the following:

easy_install http://trac-hacks.org/svn/gitplugin/0.12

I get a:

error: Unexpected HTML page found at http://trac-hacks.org/svn/gitplugin/0.12

comment:9 in reply to: ↑ 8 Changed 4 years ago by jhough

Replying to andy.czerwonka@gmail.com:

If I do the following:

easy_install http://trac-hacks.org/svn/gitplugin/0.12

I get a:

error: Unexpected HTML page found at http://trac-hacks.org/svn/gitplugin/0.12

Do you have a recent version of setuptools installed(>= 0.6c9)? There's a known problem in earlier versions that causes a similar error.

comment:10 Changed 4 years ago by peter@…

  • Cc peter@… added
  • Resolution set to fixed
  • Status changed from new to closed

The plugin works beautifully for me in Trac 0.12, so I'm closing this.

comment:11 Changed 15 months ago by jteh

Kevin, do you remember by any chance why you made GitCachedRepository.normalize_rev call self.repos.get_youngest_rev() rather than self.youngest_rev; i.e. doesn't use the cached metadata? I'm guessing performance would be better if the cache were used. I realise this was a long time ago, so you probably don't remember, but thought I'd ask in case you do. :)

comment:12 Changed 15 months ago by kevin.mcconnell@…

Sorry, I'm afraid my memory doesn't go back that far :) It might be that I just wasn't aware of a better way to do it. All I can suggest is that you try it the other way and see.

Sorry I couldn't be more help!

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from hvr. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.