Ticket #1040 (closed enhancement: fixed)

Opened 5 years ago

Last modified 2 years ago

support for multiple repos

Reported by: toon.verstraelen@UGent.be Assigned to: hvr
Priority: high Component: GitPlugin
Severity: minor Keywords:
Cc: tolsen Trac Release: 0.12

Description

Hi, I'm currently trying the git plugin for the first time. Is it possible to include multiple git repositories? Will it ever be possible? I have this situation:

/var/git/project1.git
/var/git/project2.git
/var/git/project3.git

but it would be convenient to have one trac site for all these projects. Is this a good idea?

Attachments

trac-gitplugin-fix-changeset-error.patch (2.7 kB) - added by anonymous on 03/27/09 19:38:22.
Fix changeset error and make it work on the multirepo branch

Change History

(follow-up: ↓ 3 ) 06/09/07 12:46:15 changed by anonymous

  • priority changed from low to high.

It would seem this project supports multiple repos:

http://dev.laptop.org/git.do?p=projects/trac-git;a=summary

(follow-up: ↓ 4 ) 02/05/08 12:26:13 changed by hvr

if you want to have multiple repostories per Trac environment, you'll have to wait for trac:MultipleRepositorySupport

for now you have to create one Trac environment per git repository...

(in reply to: ↑ 1 ) 03/04/08 12:58:16 changed by olaf.meeuwissen@avasys.jp

Replying to anonymous:

It would seem this project supports multiple repos: http://dev.laptop.org/git.do?p=projects/trac-git;a=summary

Apart from that link now being apparently broken, they seem to be using the GitwebPlugin.

(in reply to: ↑ 2 ; follow-up: ↓ 5 ) 03/04/08 13:00:08 changed by olaf.meeuwissen@avasys.jp

Replying to hvr:

if you want to have multiple repostories per Trac environment, you'll have to wait for trac:MultipleRepositorySupport for now you have to create one Trac environment per git repository...

What about combining your git repositories in a super-repository using submodules? Would that work? See http://git.or.cz/gitwiki/GitSubmoduleTutorial for details on setting up a super-repository.

(in reply to: ↑ 4 ; follow-up: ↓ 6 ) 03/04/08 13:23:03 changed by hvr

Replying to olaf.meeuwissen@avasys.jp:

What about combining your git repositories in a super-repository using submodules? Would that work? See http://git.or.cz/gitwiki/GitSubmoduleTutorial for details on setting up a super-repository.

I doubt that GitPlugin right now properly supports submodules yet (I haven't tested it yet, and I expect issues)

(in reply to: ↑ 5 ; follow-up: ↓ 9 ) 06/06/08 05:18:03 changed by anonymous

Replying to hvr:

Replying to olaf.meeuwissen@avasys.jp:

What about combining your git repositories in a super-repository using submodules? Would that work? See http://git.or.cz/gitwiki/GitSubmoduleTutorial for details on setting up a super-repository.

I doubt that GitPlugin right now properly supports submodules yet (I haven't tested it yet, and I expect issues)

indeed ,the error is

internal error (got unexpected object kind 'commit')

08/15/08 21:45:59 changed by tolsen

  • cc set to tolsen.

(in reply to: ↑ 6 ) 01/19/09 18:27:33 changed by anonymous

This one works for me: http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html

Just some little drawbacks: The repository the subprojects are imported into must not be empty. I had to make an initial commit with a dummy file which also appears in the revision history.

(follow-up: ↓ 11 ) 02/11/09 03:14:45 changed by anonymous

So, I tried using the MultipleRepos? branch of .12 with git plugin. http://svn.edgewall.com/repos/trac/sandbox/multirepos

Everything works for the most part it seems (surprisingly), aside from when going to a changeset the links to the parent in the non-default repository tries to go to the repository path such as

Parents:    a2e0f4c40330a9e197bd44dce2f28c6ca059075f

03/27/09 19:38:22 changed by anonymous

  • attachment trac-gitplugin-fix-changeset-error.patch added.

Fix changeset error and make it work on the multirepo branch

(in reply to: ↑ 10 ; follow-up: ↓ 14 ) 03/27/09 19:42:22 changed by anonymous

  • release changed from 0.10 to 0.11.

Above patch should fix the issue encountered in above comment.

Now gitplugin appears to work nicely with multiple repositories. :)

05/05/09 09:41:48 changed by lxsameer@gmail.com

hi , does that patch is for version 0.11 of trac or 0.12? and how can i use that? i mean what should i have in my trac.ini to use multi repo?

05/06/09 22:20:32 changed by jsimpson@ziaconsulting.com

+1 on the last comment

(in reply to: ↑ 11 ) 05/31/09 11:47:32 changed by anonymous

Replying to anonymous:

Above patch should fix the issue encountered in above comment. Now gitplugin appears to work nicely with multiple repositories. :)

yep works very well here (Trac 0.12multirepos-r8245)

ty!

07/03/09 03:41:02 changed by Haw Loeung

I'm getting the following error against 0.12multirepos rev 8345.

 Trac detected an internal error:

AttributeError: components
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/web/main.py", line 467, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/web/main.py", line 212, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/versioncontrol/web_ui/browser.py", line 372, in process_request
  repo_data = self._render_repository_index(
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/versioncontrol/web_ui/browser.py", line 452, in _render_repository_index
  youngest = repos.get_changeset(repos.youngest_rev)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/versioncontrol/api.py", line 712, in <lambda>
  youngest_rev = property(lambda x: x.get_youngest_rev())
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/versioncontrol/cache.py", line 312, in get_youngest_rev
  return self.metadata.get().get(CACHE_YOUNGEST_REV)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/cache.py", line 106, in get
  return CacheManager(self.env).get(self.id, self.retriever, db)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/core.py", line 150, in __new__
  self = compmgr.components.get(cls)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/db/util.py", line 93, in __getattr__
  return getattr(self.cnx, name)
File "/usr/lib/python2.4/site-packages/Trac-0.12multirepos-py2.4.egg/trac/db/util.py", line 93, in __getattr__
  return getattr(self.cnx, name)
File "/usr/lib64/python2.4/site-packages/sqlite/main.py", line 580, in __getattr__
  raise AttributeError, key

I also get the following error when running resync

# trac-admin /data/projects/sysadmin/ repository resync "*"
Resyncing repository history for haw...
AttributeError: get_db_cnx
Traceback (most recent call last):
  File "/usr/lib64/python2.4/logging/__init__.py", line 737, in emit
    self.stream.write(fs % msg)
ValueError: I/O operation on closed file

Any ideas on how I could fix this up?

07/03/09 03:45:12 changed by Haw Loeung

Seems disabling cached_repository fixes my problems.

10/07/09 10:31:26 changed by cboos

Note that there's an upcoming API change on Trac:MultiRepos, we're going away from composite (reponame,id) for changeset and source resource and we will instead make them subresource of a Resource('repository', reponame) resource. See #T7706.

10/07/09 10:31:32 changed by cboos

  • release changed from 0.11 to 0.12.

01/27/10 17:25:28 changed by anonymous

With Multirepos r9085 I get:

2010-01-27 17:24:07,698 Trac[chrome] ERROR: Error with navigation contributor BrowserModule: TypeError: 'NoneType' object is unsubscriptable

(follow-ups: ↓ 21 ↓ 23 ) 01/27/10 17:33:08 changed by cboos

Well, I guess a 0.12 branch of that plugin is really needed at this point...

(in reply to: ↑ 20 ) 02/07/10 00:16:38 changed by kevin

Replying to cboos:

Well, I guess a 0.12 branch of that plugin is really needed at this point...

I've started working on a port of this to 0.12 at http://github.com/lentil/trac-git-plugin.

Currently the cached_repository is still not working, but with that option disabled it seems to be OK. Feel free to pull this into a new 0.12 branch if that's any help.

02/07/10 05:46:07 changed by kevin

I went ahead and added a ticket with the above patch -- #6554. Hopefully it will be of some use.

Cheers, Kevin

(in reply to: ↑ 20 ) 02/22/10 08:25:43 changed by anonymous

Replying to cboos:

Well, I guess a 0.12 branch of that plugin is really needed at this point...

there is now :-)

(follow-up: ↓ 25 ) 03/02/10 23:49:01 changed by lkraav

i'd say this can be closed as fixed.

(in reply to: ↑ 24 ) 03/07/10 13:12:58 changed by hvr

  • status changed from new to closed.
  • resolution set to fixed.

Replying to lkraav:

i'd say this can be closed as fixed.

sounds fine to me :-)


Add/Change #1040 (support for multiple repos)




Change Properties
Action