Commits

Alessio Caiazza committed 9255b80 Merge

flow: Merged <release> '2.1.0' to <master> ('default').

Comments (0)

Files changed (3)

README

-== Prerequisites ==
-
- * Python 2.5.x or above
- * Mercurial 1.3.1 or above
-
-== Basic Install ==
-
-See https://bitbucket.org/nolith/hgredmine/wiki/Home for detailed installation
-instructions, platform-specific notes, and HgRedmine user information.
-
-== License ==
-
-GPL v2
+# HgRedmine
+
+The Mercurial (Hg) Proxy for Redmine
+
+Version >= 2.0.0 are required for Redmine 2.x
+
+## Prerequisites
+
+ * Python 2.6.x or above
+ * Mercurial 1.4.8 or above
+
+## Basic Install
+
+See [the wiki][1] for detailed installation
+instructions, platform-specific notes, and HgRedmine user information.
+
+## License 
+
+GPL v2
+
+[1]: https://bitbucket.org/nolith/hgredmine/wiki/Home

hgredmine/hgweb.py

         Find repos from Redmine database.
         """
         dbcur = db.cursor()
-        dbcur.execute('SELECT projects.identifier, repositories.url, repositories.is_default ' +
-                            'FROM projects, repositories '
-                            'WHERE repositories.type=\'Repository::Mercurial\' ' +
-                            'AND projects.id = repositories.project_id '
-                       )
+        dbcur.execute(
+            'SELECT projects.identifier, repositories.url, repositories.is_default, repositories.identifier ' +
+            'FROM projects, repositories '
+            'WHERE repositories.type=\'Repository::Mercurial\' ' +
+            'AND projects.id = repositories.project_id '
+            )
         
         repos = {}
         row = dbcur.fetchone()
         
         while row:
-            if _sanitize_db_boolean(row[2]):
-                project_id = _sanitize_db_string(row[0])
-                repo_url = _sanitize_db_string(row[1])
-                repos[project_id] = repo_url
+            project_id = _sanitize_db_string(row[0])
+            repo_url = _sanitize_db_string(row[1])
+            if not _sanitize_db_boolean(row[2]):
+                project_id += ("::"+_sanitize_db_string(row[3]))
+            repos[project_id] = repo_url
             row = dbcur.fetchone()
             
         self.repos = repos.items()
         
     def _setup_repo(self, db, repo, project_id):
         dbcur = db.cursor()
+        real_project_id = project_id.split('::')[0]
         dbcur.execute('SELECT projects.name, projects.description FROM projects '
                             'WHERE projects.identifier=%s' % (self.placeholder,),
-                      (project_id, )
+                      (real_project_id, )
                      )
         
         row = dbcur.fetchone()