incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject git commit: [#6336] ticket:477 setting locale before exporting; added new commit to test repo
Date Wed, 20 Nov 2013 00:58:06 GMT
Updated Branches:
  refs/heads/master 01cfb187b -> 2fcaa7933


[#6336] ticket:477 setting locale before exporting; added new commit to test repo


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

Branch: refs/heads/master
Commit: 2fcaa79335fc3e0382ab661c77c968dace6c0712
Parents: 01cfb18
Author: coldmind <sokandpal@yandex.ru>
Authored: Fri Nov 8 18:27:48 2013 +0200
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Wed Nov 20 00:57:33 2013 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py                  |   3 +
 ForgeSVN/forgesvn/tests/data/testsvn/db/current |   2 +-
 .../forgesvn/tests/data/testsvn/db/revprops/0/6 |  13 ++
 .../forgesvn/tests/data/testsvn/db/revs/0/6     | Bin 0 -> 616 bytes
 .../forgesvn/tests/data/testsvn/db/txn-current  |   2 +-
 .../tests/functional/test_controllers.py        |  19 ++-
 .../forgesvn/tests/model/test_repository.py     | 141 +++++++++++--------
 7 files changed, 116 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 4c63df6..41369a1 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -715,6 +715,9 @@ class SVNImplementation(M.RepositoryImplementation):
         rmtree(dest, ignore_errors=True)
         path = os.path.join(self._url, path)
         try:
+            # need to set system locale to handle all symbols in filename
+            import locale
+            locale.setlocale(locale.LC_ALL, '')
             self._svn.export(path,
                              dest,
                              revision=pysvn.Revision(pysvn.opt_revision_kind.number, commit),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/ForgeSVN/forgesvn/tests/data/testsvn/db/current
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn/db/current b/ForgeSVN/forgesvn/tests/data/testsvn/db/current
index 7ed6ff8..1e8b314 100644
--- a/ForgeSVN/forgesvn/tests/data/testsvn/db/current
+++ b/ForgeSVN/forgesvn/tests/data/testsvn/db/current
@@ -1 +1 @@
-5
+6

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/ForgeSVN/forgesvn/tests/data/testsvn/db/revprops/0/6
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn/db/revprops/0/6 b/ForgeSVN/forgesvn/tests/data/testsvn/db/revprops/0/6
new file mode 100644
index 0000000..c8f1adc
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn/db/revprops/0/6
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 8
+coldmind
+K 8
+svn:date
+V 27
+2013-11-08T13:38:11.152821Z
+K 7
+svn:log
+V 0
+
+END

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/ForgeSVN/forgesvn/tests/data/testsvn/db/revs/0/6
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn/db/revs/0/6 b/ForgeSVN/forgesvn/tests/data/testsvn/db/revs/0/6
new file mode 100644
index 0000000..dffbd45
Binary files /dev/null and b/ForgeSVN/forgesvn/tests/data/testsvn/db/revs/0/6 differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/ForgeSVN/forgesvn/tests/data/testsvn/db/txn-current
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn/db/txn-current b/ForgeSVN/forgesvn/tests/data/testsvn/db/txn-current
index 7ed6ff8..45a4fb7 100644
--- a/ForgeSVN/forgesvn/tests/data/testsvn/db/txn-current
+++ b/ForgeSVN/forgesvn/tests/data/testsvn/db/txn-current
@@ -1 +1 @@
-5
+8

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index 691bd2e..6ff1bf6 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -96,13 +96,13 @@ class TestRootController(SVNTestController):
     def test_commit_browser_data(self):
         resp = self.app.get('/src/commit_browser_data')
         data = json.loads(resp.body);
-        assert data['max_row'] == 4
+        assert data['max_row'] == 5
         assert data['next_column'] == 1
         for val in data['built_tree'].values():
             if val['url'] == '/p/test/src/1/':
                 assert val['short_id'] == '[r1]'
                 assert val['column'] == 0
-                assert val['row'] == 4
+                assert val['row'] == 5
                 assert val['message'] == 'Create readme'
 
     def test_feed(self):
@@ -206,6 +206,21 @@ class TestRootController(SVNTestController):
         assert 'Your download will begin shortly' in r
 
     @onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')),
'zip binary is missing')
+    def test_tarball_cyrillic(self):
+        r = self.app.get('/src/6/tree/')
+        assert 'Download Snapshot' in r
+        r = self.app.post('/src/6/tarball').follow()
+        assert 'Checking snapshot status...' in r
+        r = self.app.get('/src/6/tarball')
+        assert 'Checking snapshot status...' in r
+        M.MonQTask.run_ready()
+        ThreadLocalORMSession.flush_all()
+        r = self.app.get('/src/6/tarball_status')
+        assert '{"status": "ready"}' in r
+        r = self.app.get('/src/6/tarball')
+        assert 'Your download will begin shortly' in r
+
+    @onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')),
'zip binary is missing')
     def test_tarball_tags_aware(self):
         h.set_context('test', 'svn-tags', neighborhood='Projects')
         shutil.rmtree(c.app.repo.tarball_path, ignore_errors=True)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2fcaa793/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 fd400ca..a51c109 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -81,19 +81,18 @@ class TestNewRepo(unittest.TestCase):
         self.rev.author_url
         self.rev.committer_url
         assert self.rev.tree._id == self.rev.tree_id
-        assert self.rev.summary == self.rev.message.splitlines()[0]
-        assert self.rev.shorthand_id() == '[r5]'
+        assert self.rev.shorthand_id() == '[r6]'
         assert self.rev.symbolic_ids == ([], [])
         assert self.rev.url() == (
-            '/p/test/src/5/')
+            '/p/test/src/6/')
         all_cis = list(self.repo.log(self.rev._id))
-        assert len(all_cis) == 5
+        assert len(all_cis) == 6
         self.rev.tree.ls()
         assert self.rev.tree.readme() == (
             'README', 'This is readme\nAnother Line\n')
         assert self.rev.tree.path() == '/'
         assert self.rev.tree.url() == (
-            '/p/test/src/5/tree/')
+            '/p/test/src/6/tree/')
         self.rev.tree.by_name['README']
         assert self.rev.tree.is_blob('README') == True
         assert self.rev.tree['a']['b']['c'].ls() == []
@@ -222,72 +221,94 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
 
     def test_log_id_only(self):
         entries = list(self.repo.log(id_only=True))
-        assert_equal(entries, [5, 4, 3, 2, 1])
+        assert_equal(entries, [6, 5, 4, 3, 2, 1])
 
     def test_log(self):
         entries = list(self.repo.log(id_only=False))
         assert_equal(entries, [
-            {'authored': {'date': datetime(2010, 11, 18, 20, 14, 21, 515743),
-                          'email': '',
-                          'name': u'rick446'},
-             'committed': {'date': datetime(2010, 11, 18, 20, 14, 21, 515743),
-                           'email': '',
-                           'name': u'rick446'},
-             'id': 5,
-             'message': u'Copied a => b',
-             'parents': [4],
+            {'parents': [5],
              'refs': ['HEAD'],
-             'size': 0,
-             'rename_details':{}},
-            {'authored': {'date': datetime(2010, 10, 8, 15, 32, 59, 383719),
-                          'email': '',
-                          'name': u'rick446'},
-             'committed': {'date': datetime(2010, 10, 8, 15, 32, 59, 383719),
-                           'email': '',
-                           'name': u'rick446'},
-             'id': 4,
+             'committed': {
+                 'date': datetime(2013, 11, 8, 13, 38, 11, 152821),
+                 'name': u'coldmind', 'email': ''},
+             'message': u'',
+             'rename_details': {},
+             'id': 6,
+             'authored': {
+                 'date': datetime(2013, 11, 8, 13, 38, 11, 152821),
+                 'name': u'coldmind',
+                 'email': ''
+             }, 'size': 0},
+            {'parents': [4],
+             'refs': [],
+             'committed': {
+                 'date': datetime(2010, 11, 18, 20, 14, 21, 515743),
+                 'name': u'rick446',
+                 'email': ''},
+             'message': u'Copied a => b',
+             'rename_details': {},
+             'id': 5,
+             'authored': {
+                 'date': datetime(2010, 11, 18, 20, 14, 21, 515743),
+                 'name': u'rick446',
+                 'email': ''},
+             'size': 0},
+            {'parents': [3],
+             'refs': [],
+             'committed': {
+                 'date': datetime(2010, 10, 8, 15, 32, 59, 383719),
+                 'name': u'rick446',
+                 'email': ''},
              'message': u'Remove hello.txt',
-             'parents': [3],
+             'rename_details': {},
+             'id': 4,
+             'authored': {
+                 'date': datetime(2010, 10, 8, 15, 32, 59, 383719),
+                 'name': u'rick446',
+                 'email': ''},
+             'size': 0},
+            {'parents': [2],
              'refs': [],
-             'size': 0,
-             'rename_details':{}},
-            {'authored': {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
-                          'email': '',
-                          'name': u'rick446'},
-             'committed': {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
-                           'email': '',
-                           'name': u'rick446'},
-             'id': 3,
+             'committed': {
+                 'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
+                 'name': u'rick446',
+                 'email': ''},
              'message': u'Modify readme',
-             'parents': [2],
+             'rename_details': {},
+             'id': 3,
+             'authored':
+                 {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
+                  'name': u'rick446',
+                  'email': ''},
+             'size': 0},
+            {'parents': [1],
              'refs': [],
-             'size': 0,
-             'rename_details':{}},
-            {'authored': {'date': datetime(2010, 10, 8, 15, 32, 36, 221863),
-                          'email': '',
-                          'name': u'rick446'},
-             'committed': {'date': datetime(2010, 10, 8, 15, 32, 36, 221863),
-                           'email': '',
-                           'name': u'rick446'},
-             'id': 2,
+             'committed': {
+                 'date': datetime(2010, 10, 8, 15, 32, 36, 221863),
+                 'name': u'rick446',
+                 'email': ''},
              'message': u'Add path',
-             'parents': [1],
+             'rename_details': {},
+             'id': 2,
+             'authored': {
+                 'date': datetime(2010, 10, 8, 15, 32, 36, 221863),
+                 'name': u'rick446',
+                 'email': ''},
+             'size': 0},
+            {'parents': [],
              'refs': [],
-             'size': 0,
-             'rename_details':{}},
-            {'authored': {'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
-                          'email': '',
-                          'name': u'rick446'},
-             'committed': {'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
-                           'email': '',
-                           'name': u'rick446'},
-             'id': 1,
+             'committed': {
+                 'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
+                 'name': u'rick446',
+                 'email': ''},
              'message': u'Create readme',
-             'parents': [],
-             'refs': [],
-             'size': 0,
-             'rename_details':{}},
-            ])
+             'rename_details': {},
+             'id': 1,
+             'authored': {
+                 'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
+                 'name': u'rick446',
+                 'email': ''},
+             'size': 0}])
 
     def test_log_file(self):
         entries = list(self.repo.log(path='/README', id_only=False))
@@ -575,7 +596,7 @@ class TestSVNRev(unittest.TestCase):
     def test_log(self):
         # path only
         commits = list(self.repo.log(self.repo.head, id_only=True))
-        assert_equal(commits, [5, 4, 3, 2, 1])
+        assert_equal(commits, [6, 5, 4, 3, 2, 1])
         commits = list(self.repo.log(self.repo.head, 'README', id_only=True))
         assert_equal(commits, [3, 1])
         commits = list(self.repo.log(1, 'README', id_only=True))


Mime
View raw message