Modify

Opened 18 years ago

Closed 15 years ago

#1040 closed enhancement (fixed)

support for multiple repos

Reported by: toon.verstraelen@… Owned by: Herbert Valerio Riedel
Priority: high Component: GitPlugin
Severity: minor Keywords:
Cc: Tim Olsen 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 (1)

trac-gitplugin-fix-changeset-error.patch (2.7 KB) - added by anonymous 16 years ago.
Fix changeset error and make it work on the multirepo branch

Download all attachments as: .zip

Change History (25)

comment:1 Changed 17 years ago by anonymous

Priority: lowhigh

It would seem this project supports multiple repos:

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

comment:2 Changed 17 years ago by Herbert Valerio Riedel

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...

comment:3 in reply to:  1 Changed 17 years ago by olaf.meeuwissen@…

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.

comment:4 in reply to:  2 ; Changed 17 years ago by olaf.meeuwissen@…

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.

comment:5 in reply to:  4 ; Changed 17 years ago by Herbert Valerio Riedel

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)

comment:6 in reply to:  5 ; Changed 16 years ago 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')

comment:7 Changed 16 years ago by Tim Olsen

Cc: Tim Olsen added; anonymous removed

comment:9 in reply to:  6 Changed 16 years ago 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.

comment:10 Changed 16 years ago 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

Changed 16 years ago by anonymous

Fix changeset error and make it work on the multirepo branch

comment:11 in reply to:  10 ; Changed 16 years ago by anonymous

Trac Release: 0.100.11

Above patch should fix the issue encountered in above comment.

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

comment:12 Changed 16 years ago by lxsameer@…

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?

comment:13 Changed 16 years ago by jsimpson@…

+1 on the last comment

comment:14 in reply to:  11 Changed 15 years ago 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!

comment:15 Changed 15 years ago 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?

comment:16 Changed 15 years ago by Haw Loeung

Seems disabling cached_repository fixes my problems.

comment:17 Changed 15 years ago by Christian Boos

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.

comment:18 Changed 15 years ago by Christian Boos

Trac Release: 0.110.12

comment:19 Changed 15 years ago 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

comment:20 Changed 15 years ago by Christian Boos

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

comment:21 in reply to:  20 Changed 15 years ago 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.

comment:22 Changed 15 years ago by kevin

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

Cheers, Kevin

comment:23 in reply to:  20 Changed 15 years ago by anonymous

Replying to cboos:

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

there is now :-)

comment:24 Changed 15 years ago by lkraav

i'd say this can be closed as fixed.

comment:25 in reply to:  24 Changed 15 years ago by Herbert Valerio Riedel

Resolution: fixed
Status: newclosed

Replying to lkraav:

i'd say this can be closed as fixed.

sounds fine to me :-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Herbert Valerio Riedel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.