allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [21/23] allura git commit: [#4542] ticket:728 Handle case when every commit has no branch (i.e. svn)
Date Mon, 16 Feb 2015 21:16:11 GMT
[#4542] ticket:728 Handle case when every commit has no branch (i.e. svn)


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

Branch: refs/heads/master
Commit: 5e5a19d8405c23a4b05fb9ef1144f325809d776b
Parents: a60ccc9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Feb 13 16:53:34 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Mon Feb 16 10:17:42 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5e5a19d8/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 1dc17ba..20bd365 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -136,7 +136,9 @@ def refresh_repo(repo, all_commits=False, notify=True, new_clone=False):
     if not all_commits and not new_clone:
         commits_by_branches = {}
         commits_by_tags = {}
-        current_branches = []
+        # svn has no branches, so we need __default__ as a fallback to collect
+        # all commits into
+        current_branches = ['__default__']
         current_tags = []
         for commit in commit_ids:
             new = repo.commit(commit)
@@ -168,7 +170,7 @@ def refresh_repo(repo, all_commits=False, notify=True, new_clone=False):
         from allura.webhooks import RepoPushWebhookSender
         params = []
         for b, commits in commits_by_branches.iteritems():
-            ref = u'refs/heads/{}'.format(b)
+            ref = u'refs/heads/{}'.format(b) if b != '__default__' else None
             params.append(dict(commit_ids=commits, ref=ref))
         for t, commits in commits_by_tags.iteritems():
             ref = u'refs/tags/{}'.format(t)


Mime
View raw message