Account Options

  1. Sign in
Google Groups Home
« Groups Home
multirepos support for GitPlugin ; submodule "support"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yann Dirson  
View profile  
 More options Sep 30 2009, 11:21 am
From: "Yann Dirson" <ydir...@linagora.com>
Date: Wed, 30 Sep 2009 17:21:35 +0200
Local: Wed, Sep 30 2009 11:21 am
Subject: [patch] multirepos support for GitPlugin ; submodule "support"
Hi guys,

While the GitPlugin worked nearly fine on a multirepos install, it still
required one slight update, which took me more time to track than to steal
the relevant code from the Hg plugin :)

Also included is a small patchlet which, even if it does not provide
proper support for git submodules, prevents trac from bombing out when it
encounters one.  It simply causes the submodule to appear as an empty dir
(which otherwise cannot exist in a git repo).

Also included below a small patch to Trac itself (multirepos branch), to
help the user guessing that what happens may be a lack of multirepos
support.

Now hoping the multirepos branch will be part of 0.12 :)

Best regards,
--
Yann

PS: it would be cool to have GitPlugin hosted in a git repo, that
would make collaboration on it much easier :)

diff --git a/tracext/git/git_fs.py b/tracext/git/git_fs.py
index 720aaea..d09f820 100644
--- a/tracext/git/git_fs.py
+++ b/tracext/git/git_fs.py
@@ -76,7 +76,15 @@ class GitConnector(Component):

         def _format_sha_link(self, formatter, ns, sha, label,
fullmatch=None):
                 try:
-                        changeset =
self.env.get_repository().get_changeset(sha)
+                        reponame = ''
+                        context = formatter.context
+                        while context:
+                                if context.resource.realm in ('source',
'changeset'):
+                                        reponame = context.resource.id[0]
+                                        break
+                                context = context.parent
+                        repo = self.env.get_repository(reponame)
+                        changeset = repo.get_changeset(sha)
                         return tag.a(label, class_="changeset",
                                      title=shorten_line(changeset.message),
href=formatter.href.changeset(sha))
@@ -296,7 +304,7 @@ class GitNode(Node):
                         # fix-up to the last commit-rev that touched this
node
                         rev = self.git.last_change(rev, p)

-                        if k=='tree':
+                        if k=='tree' or k=='commit':
                                 pass
                         elif k=='blob':
                                 kind = Node.FILE

diff --git a/trac/versioncontrol/api.py b/trac/versioncontrol/api.py index
3b6728a..36c7210 100644
--- a/trac/versioncontrol/api.py
+++ b/trac/versioncontrol/api.py
@@ -462,14 +462,17 @@ class RepositoryManager(Component):
             rdir = repoinfo.get('dir')
             rtype = repoinfo.get('type') or self.repository_type
             if not rdir:
+                self.log.warning("directory not found for repo '%s'" %
reponame)
                 return None
         elif reponame:
+            self.log.warning("invalid repo name '%s'" % reponame)
             return None
         else:
             reponame = '' # normalize the name for the default repository
rdir, rtype = self.repository_dir, self.repository_type #
don't try to lookup default repository if not set
             if not rdir:
+                self.log.warning("no default directory")
                 return None

         # get a Repository for the reponame (use a thread-level cache)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »