@@ -18,12 +18,14 @@ fixes
+++++
- fixed git protocol issues with repos-groups
- fixed git remote repos validator that prevented from cloning remote git repos
- fixes #370 ending slashes fixes for repo and groups
- fixes #368 improved git-protocol detection to handle other clients
- fixes #366 When Setting Repository Group To Blank Repo Group Wont Be
Moved To Root
1.3.1 (**2012-02-27**)
----------------------
news
++++
@@ -184,26 +184,26 @@ class ReposGroupModel(BaseModel):
old_path = repos_group.full_path
# change properties
repos_group.group_description = form_data['group_description']
repos_group.parent_group = RepoGroup.get(form_data['group_parent_id'])
repos_group.group_parent_id = form_data['group_parent_id']
repos_group.group_name = repos_group.get_new_name(form_data['group_name'])
new_path = repos_group.full_path
self.sa.add(repos_group)
self.__rename_group(old_path, new_path)
# we need to get all repositories from this new group and
# rename them accordingly to new group path
for r in repos_group.repositories:
r.repo_name = r.get_new_name(r.just_name)
self.sa.add(r)
return repos_group
except:
log.error(traceback.format_exc())
raise
def delete(self, users_group_id):
@@ -20,44 +20,50 @@ def _make_group(path, desc='desc', paren
gr = RepoGroup.get_by_group_name(path)
if gr and skip_if_exists:
return gr
gr = ReposGroupModel().create(path, desc, parent_id)
Session.commit()
class TestReposGroups(unittest.TestCase):
def setUp(self):
self.g1 = _make_group('test1', skip_if_exists=True)
self.g2 = _make_group('test2', skip_if_exists=True)
self.g3 = _make_group('test3', skip_if_exists=True)
def tearDown(self):
print 'out'
def __check_path(self, *path):
"""
Checks the path for existance !
path = [TESTS_TMP_PATH] + list(path)
path = os.path.join(*path)
return os.path.isdir(path)
def _check_folders(self):
print os.listdir(TESTS_TMP_PATH)
def __delete_group(self, id_):
ReposGroupModel().delete(id_)
def __update_group(self, id_, path, desc='desc', parent_id=None):
form_data = dict(group_name=path,
group_description=desc,
group_parent_id=parent_id,
perms_updates=[],
perms_new=[])
form_data = dict(
group_name=path,
perms_new=[]
)
gr = ReposGroupModel().update(id_, form_data)
def test_create_group(self):
g = _make_group('newGroup')
self.assertEqual(g.full_path, 'newGroup')
@@ -147,12 +153,31 @@ class TestReposGroups(unittest.TestCase)
self.assertTrue(self.__check_path('g2', 'g1'))
# test repo
self.assertEqual(r.repo_name, os.path.join('g2', 'g1', r.just_name))
def test_move_to_root(self):
g1 = _make_group('t11')
g2 = _make_group('t22',parent_id=g1.group_id)
self.assertEqual(g2.full_path,'t11/t22')
self.assertTrue(self.__check_path('t11', 't22'))
g2 = self.__update_group(g2.group_id, 'g22', parent_id=None)
self.assertEqual(g2.group_name,'g22')
# we moved out group from t1 to '' so it's full path should be 'g2'
self.assertEqual(g2.full_path,'g22')
self.assertFalse(self.__check_path('t11', 't22'))
self.assertTrue(self.__check_path('g22'))
class TestUser(unittest.TestCase):
def __init__(self, methodName='runTest'):
Session.remove()
super(TestUser, self).__init__(methodName=methodName)
def test_create_and_remove(self):
Status change: