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:19 UTC
[25/50] [abbrv] allura git commit: [#4542] ticket:728 Handle case
when every commit has no branch (i.e. svn)
[#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/ib/7827
Commit: 5e5a19d8405c23a4b05fb9ef1144f325809d776b
Parents: a60ccc9
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Feb 13 16:53:34 2015 +0000
Committer: Igor Bondarenko <je...@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)