@@ -21,6 +21,8 @@ fixes
- 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**)
----------------------
@@ -187,20 +187,20 @@ class ReposGroupModel(BaseModel):
# 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())
@@ -23,7 +23,6 @@ def _make_group(path, desc='desc', paren
return gr
gr = ReposGroupModel().create(path, desc, parent_id)
Session.commit()
@@ -31,13 +30,19 @@ 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)
@@ -49,12 +54,13 @@ class TestReposGroups(unittest.TestCase)
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)
@@ -150,6 +156,25 @@ class TestReposGroups(unittest.TestCase)
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()
Status change: