Files
@ 31f510a88584
Branch filter:
Location: kallithea/rhodecode/tests/vcs/test_repository.py
31f510a88584
6.5 KiB
text/x-python
Update minified YUI to version 2.9 built from Source.
yui.2.9.js used to be a minified version of YUI 2.9 until 5143b8df576c updated
it to something else and applied more aggresive minification. We stick to a
clean but minified version 2.9.
The license of YUI is BSD 3-clause, as described on
http://yuilibrary.com/license/ .
Since the minified version combines with GPLv3'd Javascript, it is only GPLv3'd
compliant to distribute this Object Code version with the Corresponding Source
(or offer therefor).
This yui.2.9.js is built from Source this way:
git clone https://github.com/yui/builder
git clone https://github.com/yui/yui2
cd yui2/
git checkout hudson-yui2-2800
ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing
rm -f tmp.js
for m in yahoo event dom connection animation dragdrop element datasource autocomplete container event-delegate json datatable paginator; do
rm -f build/$m/$m.js; ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js
done
java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js
The source is mirrored and available on https://kallithea-scm.org/repos/mirror .
yui.2.9.js used to be a minified version of YUI 2.9 until 5143b8df576c updated
it to something else and applied more aggresive minification. We stick to a
clean but minified version 2.9.
The license of YUI is BSD 3-clause, as described on
http://yuilibrary.com/license/ .
Since the minified version combines with GPLv3'd Javascript, it is only GPLv3'd
compliant to distribute this Object Code version with the Corresponding Source
(or offer therefor).
This yui.2.9.js is built from Source this way:
git clone https://github.com/yui/builder
git clone https://github.com/yui/yui2
cd yui2/
git checkout hudson-yui2-2800
ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing
rm -f tmp.js
for m in yahoo event dom connection animation dragdrop element datasource autocomplete container event-delegate json datatable paginator; do
rm -f build/$m/$m.js; ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js
done
java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js
The source is mirrored and available on https://kallithea-scm.org/repos/mirror .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | from __future__ import with_statement
import datetime
from rhodecode.tests.vcs.base import BackendTestMixin
from rhodecode.tests.vcs.conf import SCM_TESTS
from rhodecode.tests.vcs.conf import TEST_USER_CONFIG_FILE
from rhodecode.lib.vcs.nodes import FileNode
from rhodecode.lib.vcs.utils.compat import unittest
from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError
class RepositoryBaseTest(BackendTestMixin):
recreate_repo_per_test = False
@classmethod
def _get_commits(cls):
return super(RepositoryBaseTest, cls)._get_commits()[:1]
def test_get_config_value(self):
self.assertEqual(self.repo.get_config_value('universal', 'foo',
TEST_USER_CONFIG_FILE), 'bar')
def test_get_config_value_defaults_to_None(self):
self.assertEqual(self.repo.get_config_value('universal', 'nonexist',
TEST_USER_CONFIG_FILE), None)
def test_get_user_name(self):
self.assertEqual(self.repo.get_user_name(TEST_USER_CONFIG_FILE),
'Foo Bar')
def test_get_user_email(self):
self.assertEqual(self.repo.get_user_email(TEST_USER_CONFIG_FILE),
'foo.bar@example.com')
def test_repo_equality(self):
self.assertTrue(self.repo == self.repo)
def test_repo_equality_broken_object(self):
import copy
_repo = copy.copy(self.repo)
delattr(_repo, 'path')
self.assertTrue(self.repo != _repo)
def test_repo_equality_other_object(self):
class dummy(object):
path = self.repo.path
self.assertTrue(self.repo != dummy())
class RepositoryGetDiffTest(BackendTestMixin):
@classmethod
def _get_commits(cls):
commits = [
{
'message': 'Initial commit',
'author': 'Joe Doe <joe.doe@example.com>',
'date': datetime.datetime(2010, 1, 1, 20),
'added': [
FileNode('foobar', content='foobar'),
FileNode('foobar2', content='foobar2'),
],
},
{
'message': 'Changed foobar, added foobar3',
'author': 'Jane Doe <jane.doe@example.com>',
'date': datetime.datetime(2010, 1, 1, 21),
'added': [
FileNode('foobar3', content='foobar3'),
],
'changed': [
FileNode('foobar', 'FOOBAR'),
],
},
{
'message': 'Removed foobar, changed foobar3',
'author': 'Jane Doe <jane.doe@example.com>',
'date': datetime.datetime(2010, 1, 1, 22),
'changed': [
FileNode('foobar3', content='FOOBAR\nFOOBAR\nFOOBAR\n'),
],
'removed': [FileNode('foobar')],
},
]
return commits
def test_raise_for_wrong(self):
with self.assertRaises(ChangesetDoesNotExistError):
self.repo.get_diff('a' * 40, 'b' * 40)
class GitRepositoryGetDiffTest(RepositoryGetDiffTest, unittest.TestCase):
backend_alias = 'git'
def test_initial_commit_diff(self):
initial_rev = self.repo.revisions[0]
self.assertEqual(self.repo.get_diff(self.repo.EMPTY_CHANGESET, initial_rev), '''diff --git a/foobar b/foobar
new file mode 100644
index 0000000000000000000000000000000000000000..f6ea0495187600e7b2288c8ac19c5886383a4632
--- /dev/null
+++ b/foobar
@@ -0,0 +1 @@
+foobar
\ No newline at end of file
diff --git a/foobar2 b/foobar2
new file mode 100644
index 0000000000000000000000000000000000000000..e8c9d6b98e3dce993a464935e1a53f50b56a3783
--- /dev/null
+++ b/foobar2
@@ -0,0 +1 @@
+foobar2
\ No newline at end of file
''')
def test_second_changeset_diff(self):
revs = self.repo.revisions
self.assertEqual(self.repo.get_diff(revs[0], revs[1]), '''diff --git a/foobar b/foobar
index f6ea0495187600e7b2288c8ac19c5886383a4632..389865bb681b358c9b102d79abd8d5f941e96551 100644
--- a/foobar
+++ b/foobar
@@ -1 +1 @@
-foobar
\ No newline at end of file
+FOOBAR
\ No newline at end of file
diff --git a/foobar3 b/foobar3
new file mode 100644
index 0000000000000000000000000000000000000000..c11c37d41d33fb47741cff93fa5f9d798c1535b0
--- /dev/null
+++ b/foobar3
@@ -0,0 +1 @@
+foobar3
\ No newline at end of file
''')
def test_third_changeset_diff(self):
revs = self.repo.revisions
self.assertEqual(self.repo.get_diff(revs[1], revs[2]), '''diff --git a/foobar b/foobar
deleted file mode 100644
index 389865bb681b358c9b102d79abd8d5f941e96551..0000000000000000000000000000000000000000
--- a/foobar
+++ /dev/null
@@ -1 +0,0 @@
-FOOBAR
\ No newline at end of file
diff --git a/foobar3 b/foobar3
index c11c37d41d33fb47741cff93fa5f9d798c1535b0..f9324477362684ff692aaf5b9a81e01b9e9a671c 100644
--- a/foobar3
+++ b/foobar3
@@ -1 +1,3 @@
-foobar3
\ No newline at end of file
+FOOBAR
+FOOBAR
+FOOBAR
''')
class HgRepositoryGetDiffTest(RepositoryGetDiffTest, unittest.TestCase):
backend_alias = 'hg'
def test_initial_commit_diff(self):
initial_rev = self.repo.revisions[0]
self.assertEqual(self.repo.get_diff(self.repo.EMPTY_CHANGESET, initial_rev), '''diff --git a/foobar b/foobar
new file mode 100644
--- /dev/null
+++ b/foobar
@@ -0,0 +1,1 @@
+foobar
\ No newline at end of file
diff --git a/foobar2 b/foobar2
new file mode 100644
--- /dev/null
+++ b/foobar2
@@ -0,0 +1,1 @@
+foobar2
\ No newline at end of file
''')
def test_second_changeset_diff(self):
revs = self.repo.revisions
self.assertEqual(self.repo.get_diff(revs[0], revs[1]), '''diff --git a/foobar b/foobar
--- a/foobar
+++ b/foobar
@@ -1,1 +1,1 @@
-foobar
\ No newline at end of file
+FOOBAR
\ No newline at end of file
diff --git a/foobar3 b/foobar3
new file mode 100644
--- /dev/null
+++ b/foobar3
@@ -0,0 +1,1 @@
+foobar3
\ No newline at end of file
''')
def test_third_changeset_diff(self):
revs = self.repo.revisions
self.assertEqual(self.repo.get_diff(revs[1], revs[2]), '''diff --git a/foobar b/foobar
deleted file mode 100644
--- a/foobar
+++ /dev/null
@@ -1,1 +0,0 @@
-FOOBAR
\ No newline at end of file
diff --git a/foobar3 b/foobar3
--- a/foobar3
+++ b/foobar3
@@ -1,1 +1,3 @@
-foobar3
\ No newline at end of file
+FOOBAR
+FOOBAR
+FOOBAR
''')
# For each backend create test case class
for alias in SCM_TESTS:
attrs = {
'backend_alias': alias,
}
cls_name = alias.capitalize() + RepositoryBaseTest.__name__
bases = (RepositoryBaseTest, unittest.TestCase)
globals()[cls_name] = type(cls_name, bases, attrs)
if __name__ == '__main__':
unittest.main()
|