You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/05/24 20:17:58 UTC

[22/50] git commit: [#6046] ticket:318 fixed symbolic refs for snapshots

[#6046] ticket:318 fixed symbolic refs for snapshots


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

Branch: refs/heads/db/6007
Commit: 59f586781700b416441968164337488d7e6866b8
Parents: 79642a3
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Wed Apr 24 13:41:21 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 01:18:17 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py            |   10 ++++++----
 Allura/allura/templates/repo/tree.html             |    4 ++--
 .../forgegit/tests/functional/test_controllers.py  |    5 ++++-
 3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59f58678/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 6c8cc7d..8ccd36d 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -454,16 +454,18 @@ class CommitBrowser(BaseController):
     def tarball(self, **kw):
         if not asbool(tg.config.get('scm.repos.tarball.enable', False)):
             raise exc.HTTPNotFound()
-        status = c.app.repo.get_tarball_status(self._revision)
+        rev = self._commit.url().split('/')[-2]
+        status = c.app.repo.get_tarball_status(rev)
         if status is None:
-            allura.tasks.repo_tasks.tarball.post(revision=self._revision)
-        return dict(commit=self._commit, revision=self._revision, status=status)
+            allura.tasks.repo_tasks.tarball.post(revision=rev)
+        return dict(commit=self._commit, revision=rev, status=status)
 
     @expose('json:')
     def tarball_status(self):
         if not asbool(tg.config.get('scm.repos.tarball.enable', False)):
             raise exc.HTTPNotFound()
-        return dict(status=c.app.repo.get_tarball_status(self._revision))
+        rev = self._commit.url().split('/')[-2]
+        return dict(status=c.app.repo.get_tarball_status(rev))
 
 
     @expose('jinja:allura:templates/repo/log.html')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59f58678/Allura/allura/templates/repo/tree.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/tree.html b/Allura/allura/templates/repo/tree.html
index e1e6e86..51b22f8 100644
--- a/Allura/allura/templates/repo/tree.html
+++ b/Allura/allura/templates/repo/tree.html
@@ -31,8 +31,8 @@ Tree <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(co
 
 {% block actions %}
 {% if tarball_enable %}
-<a href="{{commit.url()}}tarball" rel="nofollow">
-    <b data-icon="{{g.icons.folder.char}}" class="ico {{g.icons.folder.css}}" title="Snapshot"> </b> Download Snapshot
+    <a href="{{request.path[:-5]}}tarball" rel="nofollow">
+        <b data-icon="{{g.icons.folder.char}}" class="ico {{g.icons.folder.css}}" title="Snapshot"> </b> Download Snapshot
 </a>
 {% endif %}
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59f58678/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 0552f8a..0d253e1 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -336,13 +336,16 @@ class TestRootController(_TestCase):
     def test_tarball(self):
         ci = self._get_ci()
         r = self.app.get(ci + 'tree/')
+        assert '/p/test/src-git/ci/master/tarball' in r
         assert 'Download Snapshot' in r
-        r = self.app.get(ci + 'tarball')
+        r = self.app.get('/p/test/src-git/ci/master/tarball')
         assert 'Generating snapshot...' in r
         M.MonQTask.run_ready()
         ThreadLocalORMSession.flush_all()
         r = self.app.get(ci + 'tarball_status')
         assert '{"status": "ready"}' in r
+        r = self.app.get('/p/test/src-git/ci/master/tarball_status')
+        assert '{"status": "ready"}' in r
 
 
 class TestRestController(_TestCase):