Changes between Version 2 and Version 3 of Ticket #10834, comment 5


Ignore:
Timestamp:
Feb 19, 2014, 12:33:34 PM (11 months ago)
Author:
rjollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10834, comment 5

    v2 v3  
    11This patch worked for me:
    22{{{#!diff
    3 *** codereviewerplugin/0.12/coderev/web_ui.py   Thu Jun 28 10:55:36 2012
    4 --- codereviewerplugin/0.12/coderev/web_ui.py   Wed Feb 19 08:30:06 2014
    5 ***************
    6 *** 121,130 ****
    7               summary['_ref'] += '/' + review.repo
    8           comment += " for [%(_ref)s]:\n\n%(summary)s" % summary
    9          
    10           # find and update tickets
    11 +         # TODO: handle when there's no explicitly named repo
    12 +         repo = RepositoryManager(self.env).get_repository(review.repo)
    13           changeset = repo.get_changeset(review.changeset)
    14           ticket_re = CommitTicketUpdater.ticket_re
    15           tickets = ticket_re.findall(changeset.message)
    16          
    17 --- 121,135 ----
    18               summary['_ref'] += '/' + review.repo
    19           comment += " for [%(_ref)s]:\n\n%(summary)s" % summary
    20          
    21           # find and update tickets
    22 +         rm = RepositoryManager(self.env)
    23 +         new_path = req.args.get('new_path')
    24 +         reponame = req.args.get('reponame')
    25 +         if reponame:
    26 +             repo = rm.get_repository(reponame)
    27 +         else:
    28 +             reponame, repo, new_path = rm.get_repository_by_path(new_path)
    29           changeset = repo.get_changeset(review.changeset)
    30           ticket_re = CommitTicketUpdater.ticket_re
    31           tickets = ticket_re.findall(changeset.message)
    32          
     3diff --git a/codereviewerplugin/0.12/coderev/web_ui.py b/codereviewerplugin/0.12/coderev/web_ui.py
     4index 5e22e11..e2de454 100644
     5--- a/codereviewerplugin/0.12/coderev/web_ui.py
     6+++ b/codereviewerplugin/0.12/coderev/web_ui.py
     7@@ -122,8 +122,13 @@ class CodeReviewerModule(Component):
     8         comment += " for [%(_ref)s]:\n\n%(summary)s" % summary
     9 
     10         # find and update tickets
     11-        # TODO: handle when there's no explicitly named repo
     12-        repo = RepositoryManager(self.env).get_repository(review.repo)
     13+        rm = RepositoryManager(self.env)
     14+        new_path = req.args.get('new_path')
     15+        reponame = req.args.get('reponame')
     16+        if reponame:
     17+            repo = rm.get_repository(reponame)
     18+        else:
     19+            reponame, repo, new_path = rm.get_repository_by_path(new_path)
     20         changeset = repo.get_changeset(review.changeset)
     21         ticket_re = CommitTicketUpdater.ticket_re
     22         tickets = ticket_re.findall(changeset.message)         
    3323}}}