allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#5969] ticket:306 Shard path name for code snapshots
Date Mon, 25 Mar 2013 16:30:18 GMT
Updated Branches:
  refs/heads/master 57ce1a414 -> 6ac00fe8b


[#5969] ticket:306 Shard path name for code 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/6ac00fe8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6ac00fe8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6ac00fe8

Branch: refs/heads/master
Commit: 6ac00fe8bb7fdcb83eaefc23e0d4b81c6c674e83
Parents: 57ce1a4
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Mar 15 11:45:08 2013 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Mon Mar 25 14:17:49 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py                |   11 +++++++++--
 ForgeGit/forgegit/tests/model/test_repository.py |    6 +++---
 ForgeSVN/forgesvn/tests/model/test_repository.py |    6 +++---
 3 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ac00fe8/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 0081ead..f822cc2 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -235,14 +235,21 @@ class Repository(Artifact, ActivityObject):
     def tarball_path(self):
         return os.path.join(tg.config.get('scm.repos.tarball.root', '/'),
                             self.tool,
-                            self.project.url()[1:],
+                            self.project.shortname[:1],
+                            self.project.shortname[:2],
+                            self.project.shortname,
                             self.name)
 
     def tarball_url(self, revision):
         shortname = c.app.repo.project.shortname.replace('/', '-')
         mount_point = c.app.repo.app.config.options.mount_point
         filename = '%s-%s-%s.tar.gz' % (shortname, mount_point, revision)
-        r = os.path.join(self.tool,self.project.url()[1:],self.name,filename)
+        r = os.path.join(self.tool,
+                         self.project.shortname[:1],
+                         self.project.shortname[:2],
+                         self.project.shortname,
+                         self.name,
+                         filename)
         return urljoin(tg.config.get('scm.repos.tarball.url_prefix', '/'), r)
 
     def get_tarball_status(self, revision):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ac00fe8/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index ac848bc..4e1d417 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -239,10 +239,10 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         self.assertEqual(new_tree.other_ids, orig_tree.other_ids)
 
     def test_tarball(self):
-        assert_equal(self.repo.tarball_path, '/tmp/tarball/git/p/test/testgit.git')
-        assert_equal(self.repo.tarball_url('HEAD'), 'file:///git/p/test/testgit.git/test-src-git-HEAD.tar.gz')
+        assert_equal(self.repo.tarball_path, '/tmp/tarball/git/t/te/test/testgit.git')
+        assert_equal(self.repo.tarball_url('HEAD'), 'file:///git/t/te/test/testgit.git/test-src-git-HEAD.tar.gz')
         self.repo.tarball('HEAD')
-        assert os.path.isfile("/tmp/tarball/git/p/test/testgit.git/test-src-git-HEAD.tar.gz")
+        assert os.path.isfile("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.tar.gz")
 
 
 class TestGitCommit(unittest.TestCase):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ac00fe8/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 2b02ad0..43d6cbc 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -266,10 +266,10 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         self.assertEqual(self.repo.count_revisions(ci), 100)
 
     def test_tarball(self):
-        assert_equal(self.repo.tarball_path, '/tmp/tarball/svn/p/test/testsvn')
-        assert_equal(self.repo.tarball_url('1'), 'file:///svn/p/test/testsvn/test-src-1.tar.gz')
+        assert_equal(self.repo.tarball_path, '/tmp/tarball/svn/t/te/test/testsvn')
+        assert_equal(self.repo.tarball_url('1'), 'file:///svn/t/te/test/testsvn/test-src-1.tar.gz')
         self.repo.tarball('1')
-        assert os.path.isfile("/tmp/tarball/svn/p/test/testsvn/test-src-1.tar.gz")
+        assert os.path.isfile("/tmp/tarball/svn/t/te/test/testsvn/test-src-1.tar.gz")
 
 class TestSVNRev(unittest.TestCase):
 


Mime
View raw message