Modify

Opened 5 years ago

Closed 10 months ago

#7034 closed defect (fixed)

Error in Section 2:AttributeError: 'NoneType' object has no attribute 'youngest_rev'

Reported by: devexchage@… Owned by: rjollos
Priority: normal Component: PeerReviewPlugin
Severity: normal Keywords:
Cc: f_develop@…, kevin@…, bunk@…, olemis Trac Release: 0.12

Description (last modified by rjollos)

We are currently using 0.12dev version

Preconditions: I do have corresponding Review rights and Plugin is enabled.

Repro steps:

  1. select Peer Review
  2. Select Create Code Review
  3. System is trying to load data in Section: "Step 2: Select the sections to be reviewed." and reports an error:
    Trac detected an internal error:
    
    AttributeError: 'NoneType' object has no attribute 'youngest_rev'
    

Attachments (2)

codereview.patch (1.6 KB) - added by anonymous 4 years ago.
CoderReview patch for 0.12
multiple-repo.patch (2.7 KB) - added by digri 2 years ago.
solves repository=None problem in trac 0.12.2

Download all attachments as: .zip

Change History (19)

Changed 4 years ago by anonymous

CoderReview patch for 0.12

comment:1 Changed 4 years ago by anonymous

Here is a patch for the problem

comment:2 Changed 4 years ago by anonymous

that patch did not work for me.

comment:3 Changed 4 years ago by anonymous

ok, i retract that last statement, i believe i do not know how to apply patches properly. any information about how to do this would be appreciated.

comment:4 Changed 4 years ago by anonymous

Try the following patch. It is not a "nice" patch, as it pulls back some removed template code from Trac. But it can be used as a temporary work-around.

diff -ru 2.2-orig/codereview/peerReviewBrowser.py 2.2-new/codereview/peerReviewBrowser.py
--- 2.2-orig/codereview/peerReviewBrowser.py    2011-04-27 17:04:47.000000000 +0800
+++ 2.2-new/codereview/peerReviewBrowser.py     2011-04-27 17:05:12.000000000 +0800
@@ -87,7 +87,7 @@
         path = req.args.get('path', '/')
         rev = req.args.get('rev')
 
-        repos = self.env.get_repository(req.authname)
+        repos = self.env.get_repository(authname=req.authname)
 
         try:
             node = get_existing_node(self.env, repos, path, rev)
diff -ru 2.2-orig/codereview/peerReviewPerform.py 2.2-new/codereview/peerReviewPerform.py
--- 2.2-orig/codereview/peerReviewPerform.py    2011-04-27 17:04:47.000000000 +0800
+++ 2.2-new/codereview/peerReviewPerform.py     2011-04-27 17:05:13.000000000 +0800
@@ -131,7 +131,7 @@
             return 'error.cs', data, None
 
         #get the respository
-        repos = self.env.get_repository(req.authname)
+        repos = self.env.get_repository(authname=req.authname)
         #get the file attributes
         data['review_path'] = resultFile.Path
         data['review_version'] = resultFile.Version
diff -ru 2.2-orig/codereview/templates/peerReviewBrowser.html 2.2-new/codereview/templates/peerReviewBrowser.html
--- 2.2-orig/codereview/templates/peerReviewBrowser.html        2011-04-27 17:04:47.000000000 +0800
+++ 2.2-new/codereview/templates/peerReviewBrowser.html 2011-04-27 17:05:13.000000000 +0800
@@ -18,6 +18,18 @@
 </py:def>
 
 <div id="content" class="browser">
+  <py:def function="browser_path_links(path_links,rev=None)">
+    <py:for each="idx, part in enumerate(path_links)"><py:with
+        vars="first = idx == 0; last = idx == len(path_links) - 1"><a
+          class="${classes('pathentry', first=first)}"
+          title="${first and _('Go to root directory') or _('View %(folder)s', folder=part.name)}"
+          href="$part.href">$part.name</a><py:if
+        test="not last"><span class="pathentry sep">/</span></py:if></py:with></py:for>
+    <py:if test="rev"><span class="pathentry sep">@</span>
+      <a class="pathentry" href="${href.changeset(rev)}" title="View changeset $rev">$rev</a>
+    </py:if>
+    <br style="clear: both" />
+  </py:def>
        <h2>${browser_path_links(path_links, stickyrev)}</h2>
 
       <div id="jumprev">
@@ -127,4 +139,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

comment:5 Changed 3 years ago by nirik

  • Cc kevin@… added

Neither one of these seems to work here. ;(

trac 0.12.2

I always get the error. ideas or things to try welcome.

comment:6 Changed 3 years ago by rjollos

  • Description modified (diff)

comment:7 Changed 3 years ago by overflow <fiolorlando@…>

Change the repository name to empty (so it will the default repository).

comment:8 Changed 3 years ago by nirik

Doesn't seem to matter here.

comment:9 Changed 2 years ago by anonymous

  • Cc bunk@… added

comment:10 Changed 2 years ago by bunk@…

I can confirm that this plugin doesn't support multiple repositories and as such requires a default repository (I had to restart apache as well). The patches are useless.

comment:11 Changed 2 years ago by digri

a combination of both patches worked for me - multiple-repo.patch

Changed 2 years ago by digri

solves repository=None problem in trac 0.12.2

comment:12 Changed 23 months ago by rjollos

  • Cc olemis added

#8800 also has a patch for multirepository support.

comment:13 Changed 22 months ago by rjollos

  • Owner changed from mikechml to rjollos
  • Status changed from new to assigned

comment:14 Changed 17 months ago by rjollos

  • Status changed from assigned to new

comment:15 Changed 10 months ago by rjollos

In 13498:

Adapts get_repository calls to 0.12 and later API. Refs #7034.

comment:16 Changed 10 months ago by rjollos

In 13500:

Use path_links.html template from Trac. Refs #7034.

comment:17 Changed 10 months ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

I believe it will work now if a (default) repository is defined. In the future we'll need to add support for multiple repositories.

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
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.