You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/02/24 12:48:20 UTC

[26/50] [abbrv] allura git commit: [#4542] ticket:728 Convert svn ids

[#4542] ticket:728 Convert svn ids


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/fea9a040
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fea9a040
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fea9a040

Branch: refs/heads/ib/7827
Commit: fea9a04054614af5e46fffe51e7bfc7f4eaf69b4
Parents: 5e5a19d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Feb 13 17:01:08 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Feb 16 10:17:42 2015 +0000

----------------------------------------------------------------------
 Allura/allura/webhooks.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/fea9a040/Allura/allura/webhooks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/webhooks.py b/Allura/allura/webhooks.py
index f727b63..03a909d 100644
--- a/Allura/allura/webhooks.py
+++ b/Allura/allura/webhooks.py
@@ -334,17 +334,24 @@ class RepoPushWebhookSender(WebhookSender):
             if len(parents) > 0:
                 # Merge commit will have multiple parents. As far as I can tell
                 # the last one will be the branch head before merge
-                return parents[-1]
+                return self._convert_id(parents[-1])
         return u''
 
     def _after(self, repo, commit_ids):
         if len(commit_ids) > 0:
-            return commit_ids[0]
+            return self._convert_id(commit_ids[0])
         return u''
 
+    def _convert_id(self, _id):
+        if ':' in _id:
+            _id = u'r' + _id.rsplit(':', 1)[1]
+        return _id
+
     def get_payload(self, commit_ids, **kw):
         app = kw.get('app') or c.app
         commits = [app.repo.commit(ci).webhook_info for ci in commit_ids]
+        for ci in commits:
+            ci['id'] = self._convert_id(ci['id'])
         before = self._before(app.repo, commit_ids)
         after = self._after(app.repo, commit_ids)
         payload = {