RC mangles repository names if the a repository group contains the "full path" to the repositories

Issue #331 resolved
created an issue

If there are repository groups that contain the "full path" in their name, RhodeCode does not correctly scan/create repository groups or repositories resulting in VCSErrors being thrown by RhodeCode. {{{ Traceback (most recent call last): File ".../rhodecode/model/db.py", line 719, in __get_instance alias = get_scm(repo_full_path)[0] File ".../vcs/utils/helpers.py", line 32 in get_scm raise VCSError("Given path %s is not a directory" % path) VCSError: Given path /tmp/-somename/repo1 is not a directory }}}

The following replicates this behavior. If you replace //tmp //with //asdf //it occurs as well. I've omitted some of the output from the install and the sqlite dumps, leaving only the relevant info. {{{


$ pip freeze | grep RhodeCode RhodeCode=1.2.3 $ mkdir -p /tmp/rpm/tmp-somename $ hg init /tmp/rpm/tmp-somename/repo1 $ cd /tmp/rpm/tmp-somename/repo1 $ date > asdf $ hg ci -A -m "testing asdf"

$ mkdir -p /tmp/src $ hg init /tmp/src/repo2 $ cd /tmp/src/repo2 $ date > asdf $ hg ci -A -m "testing asdf" }}}



$ find /tmp -name .hg /tmp/src/repo2/.hg /tmp/rpm/tmp-somename/repo1/.hg }}}

{{{ $ paster setup-app forbugreport.ini Are you sure to destroy old database ? [y/n] y Specify valid full path to your repositories you can change this later in application settings: /tmp ... }}}



$ sqlite3 rhodecode.db SQLite version 3.3.6 Enter ".help" for instructions sqlite> .dump repositories ... INSERT INTO "repositories" VALUES(1, 'src/repo2', NULL, 'hg', 2, 0, 0, 1, 'src/repo2 repository', '2012-01-03 17:00:11.891452', NULL, 1); INSERT INTO "repositories" VALUES(2, '-somename/repo1', NULL, 'hg', 2, 0, 0, 1, '-somename/repo1 repository', '2012-01-03 17:00:12.141089', NULL, 2); COMMIT; }}}

Comments (3)

  1. Marcin Kuzminski repo owner

    Yes your're rght, i rewrote that part to match previos code where '/' was used, but i checked on windows and that path is not normalized so better to use os.sep there. Thanks !

  2. Log in to comment