Marcin Kuzminski avatar Marcin Kuzminski committed bf26396 Merge

merge beta in stable branch

Comments (0)

Files changed (232)

File contents unchanged.

     Jason Harris <jason@jasonfharris.com>
     Thayne Harbaugh  <thayne@fusionio.com>
     cejones
-    Thomas Waldmann <tw-public@gmx.de>
+    Thomas Waldmann <tw-public@gmx.de>
+    Lorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>
+    Dmitri Kuznetsov
+    Jared Bunting <jared.bunting@peachjean.com>
+    Steve Romanow <slestak989@gmail.com>
+    Augosto Hermann <augusto.herrmann@planejamento.gov.br>    
+    Ankit Solanki <ankit.solanki@gmail.com>    
+    Liad Shani <liadff@gmail.com>
+    
 recursive-include rhodecode/public/css *
 recursive-include rhodecode/public/images *
 #js
-include rhodecode/public/js/yui2a.js
-include rhodecode/public/js/excanvas.min.js
-include rhodecode/public/js/yui.flot.js
-include rhodecode/public/js/graph.js
+recursive-include rhodecode/public/js *
 #templates
 recursive-include rhodecode/templates *
-
 =================================================
 Welcome to RhodeCode (RhodiumCode) documentation!
 =================================================
 using the following credentials:
 
 - username: demo
-- password: demo
+- password: demo12
 
 Source code
 -----------
 
 The latest sources can be obtained from official RhodeCode instance
-https://hg.rhodecode.org 
+https://secure.rhodecode.org 
 
 
 MIRRORS:
   Supports http/https and LDAP
 - Full permissions (private/read/write/admin) and authentication per project. 
   One account for web interface and mercurial_ push/pull/clone operations.
+- Have built in users groups for easier permission management
+- Repository groups let you group repos and manage them easier.
+- Users can fork other users repo. RhodeCode have also compare view to see
+  combined changeset for all changeset made within single push.
+- Build in commit-api let's you add, edit and commit files right from RhodeCode
+  interface using simple editor or upload form for binaries.
 - Mako templates let's you customize the look and feel of the application.
-- Beautiful diffs, annotations and source code browsing all colored by pygments.
+- Beautiful diffs, annotations and source code browsing all colored by pygments. 
+  Raw diffs are made in git-diff format, including git_ binary-patches
 - Mercurial_ branch graph and yui-flot powered graphs with zooming and statistics
 - Admin interface with user/permission management. Admin activity journal, logs
   pulls, pushes, forks, registrations and other actions made by all users.
-- Server side forks. It is possible to fork a project and modify it freely without
-  breaking the main repository.
+- Server side forks. It is possible to fork a project and modify it freely 
+  without breaking the main repository. You can even write Your own hooks 
+  and install them
 - Full text search powered by Whoosh on the source files, and file names.
   Build in indexing daemons, with optional incremental index build
   (no external search servers required all in one application)
 - Setup project descriptions and info inside built in db for easy, non 
   file-system operations
-- Intelligent cache with invalidation after push or project change, provides high 
-  performance and always up to date data.
+- Intelligent cache with invalidation after push or project change, provides 
+  high performance and always up to date data.
 - Rss / atom feeds, gravatar support, download sources as zip/tar/gz
 - Async tasks for speed and performance using celery_ (works without them too)  
 - Backup scripts can do backup of whole app and send it over scp to desired 
 Incoming / Plans
 ----------------
 
-- Project grouping
-- User groups/teams
+- Finer granular permissions per branch, repo group or subrepo
+- pull requests and web based merges
+- notification and message system 
 - SSH based authentication with server side key management
 - Code review (probably based on hg-review)
 - Full git_ support, with push/pull server (currently in beta tests)
-- Redmine integration
-- Public accessible activity feeds
+- Redmine and other bugtrackers integration
 - Commit based built in wiki system
-- Clone points and cloning from remote repositories into RhodeCode
 - More statistics and graph (global annotation + some more statistics)
-- Other advancements as development continues (or you can of course make additions and or requests)
+- Other advancements as development continues (or you can of course make 
+  additions and or requests)
 
 License
 -------
 
 [DEFAULT]
 debug = true
+pdebug = false
 ################################################################################
 ## Uncomment and replace with the address which should receive                ## 
 ## any error reports after application crash                                  ##
 app_instance_uuid = develop
 cut_off_limit = 256000
 force_https = false
+commit_parse_limit = 25
+use_gravatar = true
 
 ####################################
 ###        CELERY CONFIG        ####
 #########################################################
 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
 #########################################################
-sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
-sqlalchemy.db1.echo = True
+#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
+sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
+sqlalchemy.db1.echo = false
 sqlalchemy.db1.pool_recycle = 3600
 sqlalchemy.convert_unicode = true
 
 [handler_console]
 class = StreamHandler
 args = (sys.stderr,)
-level = NOTSET
+level = DEBUG
 formatter = color_formatter
 
 [handler_console_sql]
 class = StreamHandler
 args = (sys.stderr,)
-level = NOTSET
+level = DEBUG
 formatter = color_formatter_sql
 
 ################
 [formatter_color_formatter_sql]
 class=rhodecode.lib.colored_formatter.ColorFormatterSql
 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
-datefmt = %Y-%m-%d %H:%M:%S
+datefmt = %Y-%m-%d %H:%M:%S
+.. _api:
+
+
+API
+===
+
+
+Starting from RhodeCode version 1.2 a simple API was implemented.
+There's a single schema for calling all api methods. API is implemented
+with JSON protocol both ways. An url to send API request in RhodeCode is 
+<your_server>/_admin/api
+
+
+All clients need to send JSON data in such format::
+
+    {
+        "api_key":"<api_key>",
+        "method":"<method_name>",
+        "args":{"<arg_key>":"<arg_val>"}
+    }
+
+Example call for autopulling remotes repos using curl::
+    curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}'
+
+Simply provide 
+ - *api_key* for access and permission validation.
+ - *method* is name of method to call
+ - *args* is an key:value list of arguments to pass to method
+    
+.. note::
+    
+    api_key can be found in your user account page    
+    
+    
+RhodeCode API will return always a JSON formatted answer::
+    
+    {
+        "result": "<result>", 
+        "error": null
+    }
+
+All responses from API will be `HTTP/1.0 200 OK`, if there's an error while
+calling api *error* key from response will contain failure description 
+and result will be null.
+
+API METHODS
++++++++++++
+
+    
+pull
+----
+
+Pulls given repo from remote location. Can be used to automatically keep 
+remote repos up to date. This command can be executed only using api_key 
+belonging to user with admin rights
+
+INPUT::
+
+    api_key:"<api_key>"
+    method: "pull"
+    args: {"repo":<repo_name>}
+
+OUTPUT::
+
+    result:"Pulled from <repo_name>"
+    error:null
+
+    
+create_user
+-----------
+
+Creates new user in RhodeCode. This command can be executed only using api_key 
+belonging to user with admin rights
+
+INPUT::
+
+    api_key:"<api_key>"
+    method: "create_user"
+    args: {"username": "<username>", 
+           "password": "<password>", 
+           "active":   "<bool>", 
+           "admin":    "<bool>", 
+           "name":     "<firstname>", 
+           "lastname": "<lastname>", 
+           "email":    "<useremail>"}
+
+OUTPUT::
+
+    result:{"id": <newuserid>,
+            "msg":"created new user <username>"}
+    error:null
+    
+    
+create_users_group
+------------------
+
+creates new users group. This command can be executed only using api_key 
+belonging to user with admin rights
+
+INPUT::
+
+    api_key:"<api_key>"
+    method: "create_user"
+    args: {"name":  "<groupname>", 
+           "active":"<bool>"}
+
+OUTPUT::
+
+    result:{"id": <newusersgroupid>,
+            "msg":"created new users group <groupname>"}
+    error:null    

docs/api/index.rst

    :maxdepth: 3
 
    models
-    
+   api 

docs/changelog.rst

 Changelog
 =========
 
+1.2.0 (**2011-10-07**)
+======================
 
+
+news
+----
+
+- implemented #47 repository groups
+- implemented #89 Can setup google analytics code from settings menu
+- implemented #91 added nicer looking archive urls with more download options
+  like tags, branches
+- implemented #44 into file browsing, and added follow branch option
+- implemented #84 downloads can be enabled/disabled for each repository
+- anonymous repository can be cloned without having to pass default:default
+  into clone url
+- fixed #90 whoosh indexer can index chooses repositories passed in command 
+  line
+- extended journal with day aggregates and paging
+- implemented #107 source code lines highlight ranges
+- implemented #93 customizable changelog on combined revision ranges - 
+  equivalent of githubs compare view 
+- implemented #108 extended and more powerful LDAP configuration
+- implemented #56 users groups
+- major code rewrites optimized codes for speed and memory usage
+- raw and diff downloads are now in git format
+- setup command checks for write access to given path
+- fixed many issues with international characters and unicode. It uses utf8
+  decode with replace to provide less errors even with non utf8 encoded strings
+- #125 added API KEY access to feeds
+- #109 Repository can be created from external Mercurial link (aka. remote 
+  repository, and manually updated (via pull) from admin panel
+- beta git support - push/pull server + basic view for git repos
+- added followers page and forks page
+- server side file creation (with binary file upload interface) 
+  and edition with commits powered by codemirror 
+- #111 file browser file finder, quick lookup files on whole file tree 
+- added quick login sliding menu into main page
+- changelog uses lazy loading of affected files details, in some scenarios 
+  this can improve speed of changelog page dramatically especially for 
+  larger repositories.
+- implements #214 added support for downloading subrepos in download menu.
+- Added basic API for direct operations on rhodecode via JSON
+- Implemented advanced hook management
+
+fixes
+-----
+
+- fixed file browser bug, when switching into given form revision the url was 
+  not changing
+- fixed propagation to error controller on simplehg and simplegit middlewares
+- fixed error when trying to make a download on empty repository
+- fixed problem with '[' chars in commit messages in journal
+- fixed #99 Unicode errors, on file node paths with non utf-8 characters
+- journal fork fixes
+- removed issue with space inside renamed repository after deletion
+- fixed strange issue on formencode imports
+- fixed #126 Deleting repository on Windows, rename used incompatible chars. 
+- #150 fixes for errors on repositories mapped in db but corrupted in 
+  filesystem
+- fixed problem with ascendant characters in realm #181
+- fixed problem with sqlite file based database connection pool
+- whoosh indexer and code stats share the same dynamic extensions map
+- fixes #188 - relationship delete of repo_to_perm entry on user removal
+- fixes issue #189 Trending source files shows "show more" when no more exist
+- fixes issue #197 Relative paths for pidlocks
+- fixes issue #198 password will require only 3 chars now for login form
+- fixes issue #199 wrong redirection for non admin users after creating a repository
+- fixes issues #202, bad db constraint made impossible to attach same group 
+  more than one time. Affects only mysql/postgres
+- fixes #218 os.kill patch for windows was missing sig param
+- improved rendering of dag (they are not trimmed anymore when number of 
+  heads exceeds 5)
+    
 1.1.8 (**2011-04-12**)
 ======================
 
   Thomas Waldmann
 - fixed issue #166 summary pager was skipping 10 revisions on second page
 
+
 1.1.7 (**2011-03-23**)
 ======================
 
 - journal fixes
 - fixed option to access repository just by entering http://server/<repo_name> 
 
-
 1.1.3 (**2011-02-16**)
 ======================
 

File contents unchanged.

docs/enable_git.rst

-.. _enable_git:
-
-Enabling GIT support (beta)
-===========================
-
-
-Git support in RhodeCode 1.1 was disabled due to current instability issues. However,
-if you would like to test git support please feel free to re-enable it. To re-enable GIT support just
-uncomment the git line in the file rhodecode/__init__.py
-
-.. code-block:: python
- 
-   BACKENDS = {
-       'hg': 'Mercurial repository',
-       #'git': 'Git repository',
-   }
-
-.. note::
-   Please note that the git support provided by RhodeCode is not yet fully
-   stable and RhodeCode might crash while using git repositories. (That is why
-   it is currently disabled.) Thus be careful about enabling git support, and
-   certainly don't use it in a production setting!
 .. toctree::
    :maxdepth: 1
 
-   enable_git
-   statistics
+   usage/general
+   usage/enable_git
+   usage/statistics
+   usage/backup
+   usage/api_key_access
    
 **Develop**
 

docs/installation.rst

 Installation
 ============
 
-``RhodeCode`` is written entirely in Python. In order to gain maximum performance
-there are some third-party you must install. When RhodeCode is used 
-together with celery you have to install some kind of message broker,
-recommended one is rabbitmq_ to make the async tasks work.
+``RhodeCode`` is written entirely in Python. Before posting any issues make 
+sure, your not missing any system libraries and using right version of 
+libraries required by RhodeCode. There's also restriction in terms of mercurial
+clients. Minimal version of hg client known working fine with RhodeCode is
+**1.6**. If you're using older client, please upgrade.
 
-Of course RhodeCode works in sync mode also and then you do not have to install
-any third party applications. However, using Celery_ will give you a large 
-speed improvement when using many big repositories. If you plan to use 
-RhodeCode for say 7 to 10 small repositories, RhodeCode will perform perfectly 
-well without celery running.
-   
-If you make the decision to run RhodeCode with celery make sure you run 
-celeryd using paster and message broker together with the application.   
 
 Installing RhodeCode from Cheese Shop
 -------------------------------------
 ---------------------------------
 
 
-- Assuming you have installed virtualenv_ create a new virtual environment using virtualenv:: 
+For installing RhodeCode i highly recommend using separate virtualenv_. This
+way many required by RhodeCode libraries will remain sandboxed from your main
+python and making things less problematic when doing system python updates. 
+
+- Assuming you have installed virtualenv_ create a new virtual environment 
+  using virtualenv command:: 
 
     virtualenv --no-site-packages /var/www/rhodecode-venv
 
    ``virtualenv`` script.  It's perfectly acceptable (and desirable)
    to create a virtualenv as a normal user.
      
-- Make a folder for rhodecode somewhere on the filesystem for example::
+- Make a folder for rhodecode data files, and configuration somewhere on the 
+  filesystem. For example::
 
     mkdir /var/www/rhodecode
   
     
-- Run this command to install rhodecode::
+- Go into the created directory run this command to install rhodecode::
 
-    easy_install rhodecode 
+    easy_install rhodecode
+  
+  or::
+ 
+    pip install rhodecode 
 
-- This will install rhodecode together with pylons and all other required python
-  libraries
+- This will install rhodecode together with pylons and all other required 
+  python libraries into activated virtualenv
 
 Requirements for Celery (optional)
 ----------------------------------
 
+In order to gain maximum performance
+there are some third-party you must install. When RhodeCode is used 
+together with celery you have to install some kind of message broker,
+recommended one is rabbitmq_ to make the async tasks work.
+
+Of course RhodeCode works in sync mode also and then you do not have to install
+any third party applications. However, using Celery_ will give you a large 
+speed improvement when using many big repositories. If you plan to use 
+RhodeCode for say 7 to 10 repositories, RhodeCode will perform perfectly well 
+without celery running.
+   
+If you make the decision to run RhodeCode with celery make sure you run 
+celeryd using paster and message broker together with the application. 
+
 .. note::
    Installing message broker and using celery is optional, RhodeCode will
    work perfectly fine without them.
 
 
 Setting up RhodeCode
---------------------------
+--------------------
 
-First, you will need to create a RhodeCode configuration file. Run the following
-command to do this::
+First, you will need to create a RhodeCode configuration file. Run the 
+following command to do this::
  
     paster make-config RhodeCode production.ini
 
 - This will create the file `production.ini` in the current directory. This
-  configuration file contains the various settings for RhodeCode, e.g proxy port,
-  email settings, usage of static files, cache, celery settings and logging.
+  configuration file contains the various settings for RhodeCode, e.g proxy 
+  port, email settings, usage of static files, cache, celery settings and 
+  logging.
 
 
 Next, you need to create the databases used by RhodeCode. I recommend that you
 
 This will prompt you for a "root" path. This "root" path is the location where
 RhodeCode will store all of its repositories on the current machine. After
-entering this "root" path ``setup-app`` will also prompt you for a username and password
-for the initial admin account which ``setup-app`` sets up for you.
+entering this "root" path ``setup-app`` will also prompt you for a username 
+and password for the initial admin account which ``setup-app`` sets up for you.
 
 - The ``setup-app`` command will create all of the needed tables and an admin
-  account. When choosing a root path you can either use a new empty location, or a
-  location which already contains existing repositories. If you choose a location
-  which contains existing repositories RhodeCode will simply add all of the
-  repositories at the chosen location to it's database. (Note: make sure you
-  specify the correct path to the root).
+  account. When choosing a root path you can either use a new empty location, 
+  or a location which already contains existing repositories. If you choose a 
+  location which contains existing repositories RhodeCode will simply add all 
+  of the repositories at the chosen location to it's database. (Note: make 
+  sure you specify the correct path to the root).
 - Note: the given path for mercurial_ repositories **must** be write accessible
-  for the application. It's very important since the RhodeCode web interface will
-  work without write access, but when trying to do a push it will eventually fail
-  with permission denied errors unless it has write access.
+  for the application. It's very important since the RhodeCode web interface 
+  will work without write access, but when trying to do a push it will 
+  eventually fail with permission denied errors unless it has write access.
 
 You are now ready to use RhodeCode, to run it simply execute::
  
 - This command runs the RhodeCode server. The web app should be available at the 
   127.0.0.1:5000. This ip and port is configurable via the production.ini 
   file created in previous step
-- Use the admin account you created above when running ``setup-app`` to login to the web app.
+- Use the admin account you created above when running ``setup-app`` to login 
+  to the web app.
 - The default permissions on each repository is read, and the owner is admin. 
   Remember to update these if needed.
 - In the admin panel you can toggle ldap, anonymous, permissions settings. As
 
 Try copying your own mercurial repository into the "root" directory you are
 using, then from within the RhodeCode web application choose Admin >
-repositories. Then choose Add New Repository. Add the repository you copied into
-the root. Test that you can browse your repository from within RhodeCode and then
-try cloning your repository from RhodeCode with::
+repositories. Then choose Add New Repository. Add the repository you copied 
+into the root. Test that you can browse your repository from within RhodeCode 
+and then try cloning your repository from RhodeCode with::
 
     hg clone http://127.0.0.1:5000/<repository name>
 
 Using RhodeCode with SSH
 ------------------------
 
-RhodeCode currently only hosts repositories using http and https. (The addition of
-ssh hosting is a planned future feature.) However you can easily use ssh in
+RhodeCode currently only hosts repositories using http and https. (The addition
+of ssh hosting is a planned future feature.) However you can easily use ssh in
 parallel with RhodeCode. (Repository access via ssh is a standard "out of
 the box" feature of mercurial_ and you can use this to access any of the
 repositories that RhodeCode is hosting. See PublishingRepositories_)
 as the project. When using repository groups, each group is a subdirectory.
 This allows you to easily use ssh for accessing repositories.
 
-In order to use ssh you need to make sure that your web-server and the users login
-accounts have the correct permissions set on the appropriate directories. (Note
-that these permissions are independent of any permissions you have set up using
-the RhodeCode web interface.)
+In order to use ssh you need to make sure that your web-server and the users 
+login accounts have the correct permissions set on the appropriate directories.
+(Note that these permissions are independent of any permissions you have set up
+using the RhodeCode web interface.)
 
 If your main directory (the same as set in RhodeCode settings) is for example
 set to **/home/hg** and the repository you are using is named `rhodecode`, then
 permissions as set up via the RhodeCode web interface, you can create an
 authentication hook to connect to the rhodecode db and runs check functions for
 permissions against that.
-
-
     
 Setting up Whoosh full text search
 ----------------------------------
 
 Starting from version 1.1 the whoosh index can be build by using the paster
 command ``make-index``. To use ``make-index`` you must specify the configuration
-file that stores the location of the index, and the location of the repositories
-(`--repo-location`).
+file that stores the location of the index. You may specify the location of the 
+repositories (`--repo-location`).  If not specified, this value is retrieved 
+from the RhodeCode database.  This was required prior to 1.2.  Starting from 
+version 1.2 it is also possible to specify a comma separated list of 
+repositories (`--index-only`) to build index only on chooses repositories 
+skipping any other found in repos location
 
 You may optionally pass the option `-f` to enable a full index rebuild. Without
 the `-f` option, indexing will run always in "incremental" mode.
 
 For an incremental index build use::
 
-	paster make-index production.ini --repo-location=<location for repos> 
+	paster make-index production.ini 
 
 For a full index rebuild use::
 
-	paster make-index production.ini -f --repo-location=<location for repos>
+	paster make-index production.ini -f 
 
-- For full text search you can either put crontab entry for
+
+building index just for chosen repositories is possible with such command::
+ 
+ paster make-index production.ini --index-only=vcs,rhodecode
+
 
 In order to do periodical index builds and keep your index always up to date.
 It's recommended to do a crontab entry for incremental indexing. 
 An example entry might look like this::
  
- /path/to/python/bin/paster /path/to/rhodecode/production.ini --repo-location=<location for repos> 
+    /path/to/python/bin/paster make-index /path/to/rhodecode/production.ini 
   
 When using incremental mode (the default) whoosh will check the last
 modification date of each file and add it to be reindexed if a newer file is
 -----------------------
 
 RhodeCode starting from version 1.1 supports ldap authentication. In order
-to use LDAP, you have to install the python-ldap_ package. This package is available
-via pypi, so you can install it by running
+to use LDAP, you have to install the python-ldap_ package. This package is 
+available via pypi, so you can install it by running
 
-::
+using easy_install::
 
- easy_install python-ldap
+    easy_install python-ldap
  
-::
+using pip::
 
- pip install python-ldap
+    pip install python-ldap
 
 .. note::
    python-ldap requires some certain libs on your system, so before installing 
    it check that you have at least `openldap`, and `sasl` libraries.
 
-ldap settings are located in admin->ldap section,
+LDAP settings are located in admin->ldap section,
 
 Here's a typical ldap setup::
 
- Enable ldap  = checked                 #controls if ldap access is enabled
- Host         = host.domain.org         #actual ldap server to connect
- Port         = 389 or 689 for ldaps    #ldap server ports
- Enable LDAPS = unchecked               #enable disable ldaps
- Account      = <account>               #access for ldap server(if required)
- Password     = <password>              #password for ldap server(if required)
- Base DN      = uid=%(user)s,CN=users,DC=host,DC=domain,DC=org
- 
+ Connection settings
+ Enable LDAP          = checked
+ Host                 = host.example.org
+ Port                 = 389
+ Account              = <account>
+ Password             = <password>
+ Connection Security  = LDAPS connection
+ Certificate Checks   = DEMAND
 
-`Account` and `Password` are optional, and used for two-phase ldap 
-authentication so those are credentials to access your ldap, if it doesn't 
-support anonymous search/user lookups. 
+ Search settings
+ Base DN              = CN=users,DC=host,DC=example,DC=org
+ LDAP Filter          = (&(objectClass=user)(!(objectClass=computer)))
+ LDAP Search Scope    = SUBTREE
 
-Base DN must have the %(user)s template inside, it's a place holder where your uid
-used to login would go. It allows admins to specify non-standard schema for the
-uid variable.
+ Attribute mappings
+ Login Attribute      = uid
+ First Name Attribute = firstName
+ Last Name Attribute  = lastName
+ E-mail Attribute     = mail
 
-If all of the data is correctly entered, and `python-ldap` is properly
-installed, then users should be granted access to RhodeCode with ldap accounts.
-When logging in the first time a special ldap account is created inside
-RhodeCode, so you can control the permissions even on ldap users. If such users
-already exist in the RhodeCode database, then the ldap user with the same
-username would be not be able to access RhodeCode.
+.. _enable_ldap:
 
-If you have problems with ldap access and believe you have correctly entered the
-required information then proceed by investigating the RhodeCode logs. Any
-error messages sent from ldap will be saved there.
+Enable LDAP : required
+    Whether to use LDAP for authenticating users.
 
+.. _ldap_host:
+
+Host : required
+    LDAP server hostname or IP address.
+
+.. _Port:
+
+Port : required
+    389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
+
+.. _ldap_account:
+
+Account : optional
+    Only required if the LDAP server does not allow anonymous browsing of
+    records.  This should be a special account for record browsing.  This
+    will require `LDAP Password`_ below.
+
+.. _LDAP Password:
+
+Password : optional
+    Only required if the LDAP server does not allow anonymous browsing of
+    records.
+
+.. _Enable LDAPS:
+
+Connection Security : required
+    Defines the connection to LDAP server
+
+    No encryption
+        Plain non encrypted connection
+        
+    LDAPS connection
+        Enable ldaps connection. It will likely require `Port`_ to be set to 
+        a different value (standard LDAPS port is 636). When LDAPS is enabled 
+        then `Certificate Checks`_ is required.
+        
+    START_TLS on LDAP connection
+        START TLS connection
+
+.. _Certificate Checks:
+
+Certificate Checks : optional
+    How SSL certificates verification is handled - this is only useful when
+    `Enable LDAPS`_ is enabled.  Only DEMAND or HARD offer full SSL security 
+    while the other options are susceptible to man-in-the-middle attacks.  SSL
+    certificates can be installed to /etc/openldap/cacerts so that the
+    DEMAND or HARD options can be used with self-signed certificates or
+    certificates that do not have traceable certificates of authority.
+
+    NEVER
+        A serve certificate will never be requested or checked.
+
+    ALLOW
+        A server certificate is requested.  Failure to provide a
+        certificate or providing a bad certificate will not terminate the
+        session.
+
+    TRY
+        A server certificate is requested.  Failure to provide a
+        certificate does not halt the session; providing a bad certificate
+        halts the session.
+
+    DEMAND
+        A server certificate is requested and must be provided and
+        authenticated for the session to proceed.
+
+    HARD
+        The same as DEMAND.
+
+.. _Base DN:
+
+Base DN : required
+    The Distinguished Name (DN) where searches for users will be performed.
+    Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
+
+.. _LDAP Filter:
+
+LDAP Filter : optional
+    A LDAP filter defined by RFC 2254.  This is more useful when `LDAP
+    Search Scope`_ is set to SUBTREE.  The filter is useful for limiting
+    which LDAP objects are identified as representing Users for
+    authentication.  The filter is augmented by `Login Attribute`_ below.
+    This can commonly be left blank.
+
+.. _LDAP Search Scope:
+
+LDAP Search Scope : required
+    This limits how far LDAP will search for a matching object.
+
+    BASE
+        Only allows searching of `Base DN`_ and is usually not what you
+        want.
+
+    ONELEVEL
+        Searches all entries under `Base DN`_, but not Base DN itself.
+
+    SUBTREE
+        Searches all entries below `Base DN`_, but not Base DN itself.
+        When using SUBTREE `LDAP Filter`_ is useful to limit object
+        location.
+
+.. _Login Attribute:
+
+Login Attribute : required        
+    The LDAP record attribute that will be matched as the USERNAME or
+    ACCOUNT used to connect to RhodeCode.  This will be added to `LDAP
+    Filter`_ for locating the User object.  If `LDAP Filter`_ is specified as
+    "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
+    connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
+    ::
+
+        (&(LDAPFILTER)(uid=jsmith))
+
+.. _ldap_attr_firstname:
+
+First Name Attribute : required
+    The LDAP record attribute which represents the user's first name.
+
+.. _ldap_attr_lastname:
+
+Last Name Attribute : required
+    The LDAP record attribute which represents the user's last name.
+
+.. _ldap_attr_email:
+
+Email Attribute : required
+    The LDAP record attribute which represents the user's email address.
+
+If all data are entered correctly, and python-ldap_ is properly installed
+users should be granted access to RhodeCode with ldap accounts.  At this
+time user information is copied from LDAP into the RhodeCode user database.
+This means that updates of an LDAP user object may not be reflected as a
+user update in RhodeCode.
+
+If You have problems with LDAP access and believe You entered correct
+information check out the RhodeCode logs, any error messages sent from LDAP
+will be saved there.
+
+Active Directory
+''''''''''''''''
+
+RhodeCode can use Microsoft Active Directory for user authentication.  This
+is done through an LDAP or LDAPS connection to Active Directory.  The
+following LDAP configuration settings are typical for using Active
+Directory ::
+
+ Base DN              = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
+ Login Attribute      = sAMAccountName
+ First Name Attribute = givenName
+ Last Name Attribute  = sn
+ E-mail Attribute     = mail
+
+All other LDAP settings will likely be site-specific and should be
+appropriately configured.
+
+
+
+Hook management
+---------------
+
+Hooks can be managed in similar way to this used in .hgrc files.
+To access hooks setting click `advanced setup` on Hooks section of Mercurial
+Settings in Admin. 
+
+There are 4 built in hooks that cannot be changed (only enable/disable by
+checkboxes on previos section).
+To add another custom hook simply fill in first section with 
+<name>.<hook_type> and the second one with hook path. Example hooks
+can be found at *rhodecode.lib.hooks*. 
 
 
 Setting Up Celery
 
 
 .. note::
-   Make sure you run this command from the same virtualenv, and with the same user
-   that rhodecode runs.
+   Make sure you run this command from the same virtualenv, and with the same 
+   user that rhodecode runs.
    
 HTTPS support
 -------------
 
 - Set HTTP_X_URL_SCHEME in your http server headers, than rhodecode will
   recognize this headers and make proper https redirections
-- Alternatively, set `force_https = true` in the ini configuration to force using
-  https, no headers are needed than to enable https
+- Alternatively, change the `force_https = true` flag in the ini configuration 
+  to force using https, no headers are needed than to enable https
 
 
 Nginx virtual host example
     client_max_body_size        400m;
     client_body_buffer_size     128k;
     proxy_buffering             off;
-    proxy_connect_timeout       3600;
-    proxy_send_timeout          3600;
-    proxy_read_timeout          3600;
-    proxy_buffer_size           16k;
-    proxy_buffers               4 16k;
-    proxy_busy_buffers_size     64k;
-    proxy_temp_file_write_size  64k;
+    proxy_connect_timeout       7200;
+    proxy_send_timeout          7200;
+    proxy_read_timeout          7200;
+    proxy_buffers               8 32k;
  
 Also, when using root path with nginx you might set the static files to false
 in the production.ini file::
       SetEnvIf X-Url-Scheme https HTTPS=1
     </Location> 
 
-Besides the regular apache setup you will need to add the following to your .ini file::
+Besides the regular apache setup you will need to add the following line
+into [app:main] section of your .ini file::
 
     filter-with = proxy-prefix
 
 
 then change <someprefix> into your choosen prefix
 
-Apache's example WSGI+SSL config
---------------------------------
+Apache's WSGI config
+--------------------
 
-virtual host example::
 
-    <VirtualHost *:443>
-        ServerName hg.domain.eu:443
-        DocumentRoot /var/www
-    
-        SSLEngine on
-        SSLCertificateFile /etc/apache2/ssl/hg.domain.eu.cert
-        SSLCertificateKeyFile /etc/apache2/ssl/hg.domain.eu.key
-        SSLCertificateChainFile /etc/apache2/ssl/ca.cert
-        SetEnv HTTP_X_URL_SCHEME https
-    
-        Alias /css /home/web/virtualenvs/hg/lib/python2.6/site-packages/rhodecode/public/css
-        Alias /images /home/web/virtualenvs/hg/lib/python2.6/site-packages/rhodecode/public/images
-        Alias /js /home/web/virtualenvs/hg/lib/python2.6/site-packages/rhodecode/public/js
-    
-        WSGIDaemonProcess hg user=web group=web processes=1 threads=10 display-name=%{GROUP} python-path=/home/web/virtualenvs/hg/lib/python2.6/site-packages
-    
-        WSGIPassAuthorization On
-        WSGIProcessGroup hg
-        WSGIApplicationGroup hg
-        WSGIScriptAlias / /home/web/apache/conf/hg.wsgi
-    
-        <Directory /home/web/apache/conf>
-            Order deny,allow
-            Allow from all
-        </Directory>
-        <Directory /var/www>
-            Order deny,allow
-            Allow from all
-        </Directory>
-    
-    </VirtualHost>
-
-    <VirtualHost *:80>
-        ServerName hg.domain.eu
-        Redirect permanent / https://hg.domain.eu/
-    </VirtualHost>
-
-
-HG.WSGI::
+Example wsgi dispatch script::
 
     import os
     os.environ["HGENCODING"] = "UTF-8"
+    os.environ['PYTHON_EGG_CACHE'] = '/home/web/rhodecode/.egg-cache'
+    
+    # sometimes it's needed to set the curent dir
+    os.chdir('/home/web/rhodecode/') 
     
     from paste.deploy import loadapp
     from paste.script.util.logging_config import fileConfig
-    
-    fileConfig('/home/web/virtualenvs/hg/config/production.ini')
-    application = loadapp('config:/home/web/virtualenvs/hg/config/production.ini'
+
+    fileConfig('/home/web/rhodecode/production.ini')
+    application = loadapp('config:/home/web/rhodecode/production.ini')
 
 
 Other configuration files
 :Q: **Apache doesn't pass basicAuth on pull/push?**
 :A: Make sure you added `WSGIPassAuthorization true`.
 
-For further questions search the `Issues tracker`_, or post a message in the `google group rhodecode`_
+For further questions search the `Issues tracker`_, or post a message in the 
+`google group rhodecode`_
 
 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
 .. _python: http://www.python.org/

docs/statistics.rst

-.. _statistics:
-
-
-Statistics
-==========
-
-The RhodeCode statistics system makes heavy demands of the server resources, so
-in order to keep a balance between usability and performance, the statistics are
-cached inside db and are gathered incrementally, this is how RhodeCode does
-this:
-
-With Celery disabled
-++++++++++++++++++++
-
-- On each first visit to the summary page a set of 250 commits are parsed and
-  updates statistics cache.
-- This happens on each single visit to the statistics page until all commits are
-  fetched. Statistics are kept cached until additional commits are added to the
-  repository. In such a case RhodeCode will only fetch the new commits when
-  updating it's cache.
-
-
-With Celery enabled
-+++++++++++++++++++
-
-- On the first visit to the summary page RhodeCode will create tasks that will
-  execute on celery workers. This task will gather all of the stats until all
-  commits are parsed, each task will parse 250 commits, and run the next task to
-  parse next 250 commits, until all of the commits are parsed.
-
-.. note::
-   At any time you can disable statistics on each repository via the repository
-   edit form in the admin panel. To do this just uncheck the statistics checkbox.

File contents unchanged.

docs/usage/api_key_access.rst

+.. _api_key_access:
+
+Access to RhodeCode via API KEY
+===============================
+
+Starting from version 1.2 rss/atom feeds and journal feeds
+can be accessed via **api_key**. This unique key is automatically generated for
+each user in RhodeCode application. Using this key it is possible to access 
+feeds without having to log in. When user changes his password a new API KEY
+is generated for him automatically. You can check your API KEY in account 
+settings page. 

docs/usage/backup.rst

+.. _backup:
+
+Backing up RhodeCode
+====================
+
+
+Settings
+--------
+
+Just copy your .ini file, it contains all RhodeCode settings.
+
+Whoosh index
+------------
+
+Whoosh index is located in **/data/index** directory where you installed
+RhodeCode ie. the same place where the ini file is located
+
+
+Database
+--------
+
+When using sqlite just copy rhodecode.db.
+Any other database engine requires a manual backup operation.
+
+Database backup will contain all gathered statistics

docs/usage/enable_git.rst

+.. _enable_git:
+
+Enabling GIT support (beta)
+===========================
+
+
+Git support in RhodeCode 1.1 was disabled due to current instability issues. 
+However,if you would like to test git support please feel free to re-enable it. 
+To re-enable GIT support just uncomment the git line in the 
+file **rhodecode/__init__.py**
+
+.. code-block:: python
+ 
+   BACKENDS = {
+       'hg': 'Mercurial repository',
+       #'git': 'Git repository',
+   }
+
+.. note::
+   Please note that the git support provided by RhodeCode is not yet fully
+   stable and RhodeCode might crash while using git repositories. (That is why
+   it is currently disabled.) Thus be careful about enabling git support, and
+   certainly don't use it in a production setting!
+   

docs/usage/general.rst

+.. _general:
+
+General RhodeCode usage
+=======================
+
+
+Repository deleting
+-------------------
+
+Currently when admin/owner deletes a repository, RhodeCode does not physically
+delete a repository from filesystem, it renames it in a special way so it's
+not possible to push,clone or access repository. It's worth a notice that,
+even if someone will be given administrative access to RhodeCode and will 
+delete a repository You can easy restore such action by restoring `rm__<date>`
+from the repository name, and internal repository storage (.hg/.git)
+
+Follow current branch in file view
+----------------------------------
+
+In file view when this checkbox is checked the << and >> arrows will jump
+to changesets within the same branch currently viewing. So for example
+if someone is viewing files at 'beta' branch and marks `follow current branch`
+checkbox the << and >> buttons will only show him revisions for 'beta' branch
+
+
+Compare view from changelog
+---------------------------
+
+Checkboxes in compare view allow users to view combined compare view. You can
+only show the range between the first and last checkbox (no cherry pick).
+Clicking more than one checkbox will activate a link in top saying
+`Show selected changes <from-rev> -> <to-rev>` clicking this will bring
+compare view
+
+Compare view is also available from the journal on pushes having more than
+one changeset
+
+
+
+Mailing
+-------
+
+When administrator will fill up the mailing settings in .ini files
+RhodeCode will send mails on user registration, or when RhodeCode errors occur
+on errors the mails will have a detailed traceback of error.
+
+
+Trending source files
+---------------------
+
+Trending source files are calculated based on pre defined dict of known
+types and extensions. If You miss some extension or Would like to scan some
+custom files it's possible to add new types in `LANGUAGES_EXTENSIONS_MAP` dict
+located in `/rhodecode/lib/celerylib/tasks.py`

docs/usage/statistics.rst

+.. _statistics:
+
+
+Statistics
+==========
+
+The RhodeCode statistics system makes heavy demands of the server resources, so
+in order to keep a balance between usability and performance, the statistics are
+cached inside db and are gathered incrementally, this is how RhodeCode does
+this:
+
+With Celery disabled
+--------------------
+
+- On each first visit to the summary page a set of 250 commits are parsed and
+  updates statistics cache.
+- This happens on each single visit to the statistics page until all commits are
+  fetched. Statistics are kept cached until additional commits are added to the
+  repository. In such a case RhodeCode will only fetch the new commits when
+  updating it's cache.
+
+
+With Celery enabled
+-------------------
+
+- On the first visit to the summary page RhodeCode will create tasks that will
+  execute on celery workers. This task will gather all of the stats until all
+  commits are parsed, each task will parse 250 commits, and run the next task to
+  parse next 250 commits, until all of the commits are parsed.
+
+.. note::
+   At any time you can disable statistics on each repository via the repository
+   edit form in the admin panel. To do this just uncheck the statistics checkbox.
         except ImportError:
             from easy_install import main
         main(list(argv) + [download_setuptools(delay=0)])
-        sys.exit(0)  # try to force an exit
+        sys.exit(0) # try to force an exit
     else:
         if argv:
             from setuptools.command.easy_install import main
             main(argv)
         else:
-            print "Setuptools version", version, ("or greater has "
-                                                  "been installed.")
+            print "Setuptools version", version, "or greater has been installed."
             print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
 
 

init.d/rhodecode-daemon2

 #!/bin/sh -e
 ########################################
-#### THIS IS AN DEBIAN INIT.D SCRIPT####
+#### THIS IS A DEBIAN INIT.D SCRIPT ####
 ########################################
 
 ### BEGIN INIT INFO
 DAEMON="$PYTHON_PATH/bin/paster"
 
 DAEMON_OPTS="serve --daemon \
---user=$RUN_AS \
---group=$RUN_AS \
---pid-file=$PID_PATH \
---log-file=$LOG_PATH  $APP_PATH/$CONF_NAME"
+  --user=$RUN_AS \
+  --group=$RUN_AS \
+  --pid-file=$PID_PATH \
+  --log-file=$LOG_PATH  $APP_PATH/$CONF_NAME"
 
 
+start() {
+  echo "Starting $APP_NAME"
+  PYTHON_EGG_CACHE="/tmp" start-stop-daemon -d $APP_PATH \
+      --start --quiet \
+      --pidfile $PID_PATH \
+      --user $RUN_AS \
+      --exec $DAEMON -- $DAEMON_OPTS
+}
+
+stop() {
+  echo "Stopping $APP_NAME"
+  start-stop-daemon -d $APP_PATH \
+      --stop --quiet \
+      --pidfile $PID_PATH || echo "$APP_NAME - Not running!"
+  
+  if [ -f $PID_PATH ]; then
+    rm $PID_PATH
+  fi
+}
+
 case "$1" in
   start)
-    echo "Starting $APP_NAME"
-    start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \
-        --start --quiet \
-        --pidfile $PID_PATH \
-        --user $RUN_AS \
-        --exec $DAEMON -- $DAEMON_OPTS
+    start
     ;;
   stop)
-    echo "Stopping $APP_NAME"
-    start-stop-daemon -d $APP_PATH \
-        --stop --quiet \
-        --pidfile $PID_PATH || echo "$APP_NAME - Not running!"
-    if [ -f $PID_PATH ]; then
-        rm $PID_PATH
-    fi
+    stop
     ;;
   restart)
     echo "Restarting $APP_NAME"
     ### stop ###
-    echo "Stopping $APP_NAME"
-    start-stop-daemon -d $APP_PATH \
-        --stop --quiet \
-        --pidfile $PID_PATH || echo "$APP_NAME - Not running!"
-    if [ -f $PID_PATH ]; then
-        rm $PID_PATH
-    fi
+    stop
+    wait
     ### start ###
-    echo "Starting $APP_NAME"
-    start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \
-        --start --quiet \
-        --pidfile $PID_PATH \
-        --user $RUN_AS \
-        --exec $DAEMON -- $DAEMON_OPTS
+    start
     ;;
   *)
     echo "Usage: $0 {start|stop|restart}"
     exit 1
-esac
+esac
 
 [DEFAULT]
 debug = true
+pdebug = false
 ################################################################################
 ## Uncomment and replace with the address which should receive                ## 
 ## any error reports after application crash                                  ##
 threadpool_workers = 5
 
 ##max request before thread respawn
-threadpool_max_requests = 2
+threadpool_max_requests = 10
 
 ##option to use threads of process
 use_threadpool = true
 [app:main]
 use = egg:rhodecode
 full_stack = true
-static_files = false
+static_files = true
 lang=en
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
+app_instance_uuid = prod1234
 cut_off_limit = 256000
-force_https = false
+force_https = false 
+commit_parse_limit = 50
+use_gravatar = true
 
 ####################################
 ###        CELERY CONFIG        ####
 celeryd.concurrency = 2
 #celeryd.log.file = celeryd.log
 celeryd.log.level = debug
-celeryd.max.tasks.per.child = 3
+celeryd.max.tasks.per.child = 1
 
 #tasks will never be sent to the queue, but executed locally instead.
 celery.always.eager = false
 beaker.cache.long_term.type=memory
 beaker.cache.long_term.expire=36000
 
-
 beaker.cache.sql_cache_short.type=memory
-beaker.cache.sql_cache_short.expire=5
+beaker.cache.sql_cache_short.expire=10
 
 beaker.cache.sql_cache_med.type=memory
 beaker.cache.sql_cache_med.expire=360
 #########################################################
 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
 #########################################################
-sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
-#sqlalchemy.db1.echo = False
-#sqlalchemy.db1.pool_recycle = 3600
+#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
+sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
+sqlalchemy.db1.echo = false
+sqlalchemy.db1.pool_recycle = 3600
 sqlalchemy.convert_unicode = true
 
 ################################
 class = StreamHandler
 args = (sys.stderr,)
 level = INFO
-formatter = color_formatter
+formatter = generic
 
 [handler_console_sql]
 class = StreamHandler
 args = (sys.stderr,)
 level = WARN
-formatter = color_formatter_sql
+formatter = generic
 
 ################
 ## FORMATTERS ##

rhodecode/__init__.py

 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import platform
 
-VERSION = (1, 1, 8)
+VERSION = (1, 2, 0)
 __version__ = '.'.join((str(each) for each in VERSION[:4]))
-__dbversion__ = 2  # defines current db version for migrations
+__dbversion__ = 3 #defines current db version for migrations
 __platform__ = platform.system()
 __license__ = 'GPLv3'
 
 PLATFORM_WIN = ('Windows')
-PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD', 'OpenBSD')
+PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD', 'OpenBSD', 'SunOS')
 
 try:
     from rhodecode.lib.utils import get_current_revision

rhodecode/config/deployment.ini_tmpl

 
 [DEFAULT]
 debug = true
+pdebug = false
 ################################################################################
 ## Uncomment and replace with the address which should receive                ## 
 ## any error reports after application crash                                  ##
 app_instance_uuid = ${app_instance_uuid}
 cut_off_limit = 256000
 force_https = false 
+commit_parse_limit = 50
+use_gravatar = true
 
 ####################################
 ###        CELERY CONFIG        ####
 #########################################################
 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
 #########################################################
+
+# SQLITE [default]
 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
-#sqlalchemy.db1.echo = False
-#sqlalchemy.db1.pool_recycle = 3600
+ 
+# POSTGRES
+# sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode
+
+# MySQL
+# sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
+
+
+sqlalchemy.db1.echo = false
+sqlalchemy.db1.pool_recycle = 3600
 sqlalchemy.convert_unicode = true
 
 ################################
 ### LOGGING CONFIGURATION   ####
 ################################
 [loggers]
-keys = root, routes, rhodecode, sqlalchemy,beaker,templates
+keys = root, routes, rhodecode, sqlalchemy, beaker, templates
 
 [handlers]
-keys = console
+keys = console, console_sql
 
 [formatters]
-keys = generic,color_formatter
+keys = generic, color_formatter, color_formatter_sql
 
 #############
 ## LOGGERS ##
 #############
 [logger_root]
-level = INFO
+level = NOTSET
 handlers = console
 
 [logger_routes]
-level = INFO
-handlers = console
+level = DEBUG
+handlers = 
 qualname = routes.middleware
 # "level = DEBUG" logs the route matched and routing variables.
-propagate = 0
+propagate = 1
 
 [logger_beaker]
-level = ERROR
-handlers = console
+level = DEBUG
+handlers = 
 qualname = beaker.container
-propagate = 0
+propagate = 1
 
 [logger_templates]
 level = INFO
-handlers = console
+handlers = 
 qualname = pylons.templating
-propagate = 0
+propagate = 1
 
 [logger_rhodecode]
 level = DEBUG
-handlers = console
+handlers = 
 qualname = rhodecode
-propagate = 0
+propagate = 1
 
 [logger_sqlalchemy]
-level = ERROR
-handlers = console
+level = INFO
+handlers = console_sql
 qualname = sqlalchemy.engine
 propagate = 0
 
 [handler_console]
 class = StreamHandler
 args = (sys.stderr,)
-level = NOTSET
+level = INFO
 formatter = color_formatter
 
+[handler_console_sql]
+class = StreamHandler
+args = (sys.stderr,)
+level = WARN
+formatter = color_formatter_sql
+
 ################
 ## FORMATTERS ##
 ################
 [formatter_color_formatter]
 class=rhodecode.lib.colored_formatter.ColorFormatter
 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %Y-%m-%d %H:%M:%S
+
+[formatter_color_formatter_sql]
+class=rhodecode.lib.colored_formatter.ColorFormatterSql
+format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
 datefmt = %Y-%m-%d %H:%M:%S

rhodecode/config/environment.py

 from mako.lookup import TemplateLookup
 from pylons.configuration import PylonsConfig
 from pylons.error import handle_mako_error
-from sqlalchemy import engine_from_config
 
 import rhodecode.lib.app_globals as app_globals
 import rhodecode.lib.helpers
 
 from rhodecode.config.routing import make_map
 from rhodecode.lib import celerypylons
-from rhodecode.lib.auth import set_available_permissions, set_base_path
+from rhodecode.lib import engine_from_config
+from rhodecode.lib.timerproxy import TimerProxy
+from rhodecode.lib.auth import set_available_permissions
 from rhodecode.lib.utils import repo2db_mapper, make_ui, set_rhodecode_config
 from rhodecode.model import init_model
 from rhodecode.model.scm import ScmModel
-from rhodecode.lib.timerproxy import TimerProxy
 
 log = logging.getLogger(__name__)
 
         from rhodecode.lib.utils import create_test_env, create_test_index
         from rhodecode.tests import  TESTS_TMP_PATH
         create_test_env(TESTS_TMP_PATH, config)
-        create_test_index(TESTS_TMP_PATH, True)
+        create_test_index(TESTS_TMP_PATH, config, True)
 
     #MULTIPLE DB configs
     # Setup the SQLAlchemy database engine
-    if config['debug'] and not test:
-        #use query time debugging.
-        sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.',
-                                           proxy=TimerProxy())
-    else:
-        sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
+    sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
 
     init_model(sa_engine_db1)
-    #init baseui
-    config['pylons.app_globals'].baseui = make_ui('db')
 
-    g = config['pylons.app_globals']
-    repo2db_mapper(ScmModel().repo_scan(g.paths[0][1], g.baseui))
+    repos_path = make_ui('db').configitems('paths')[0][1]
+    repo2db_mapper(ScmModel().repo_scan(repos_path))
     set_available_permissions(config)
-    set_base_path(config)
+    config['base_path'] = repos_path
     set_rhodecode_config(config)
     # CONFIGURATION OPTIONS HERE (note: all config options will override
     # any Pylons config options)

rhodecode/config/middleware.py

     app = SessionMiddleware(app, config)
 
     # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
-
-    app = SimpleHg(app, config)
-    app = SimpleGit(app, config)
+    if asbool(config['pdebug']):
+        from rhodecode.lib.profiler import ProfilingMiddleware
+        app = ProfilingMiddleware(app)
 
     if asbool(full_stack):
         # Handle Python exceptions
         app = Cascade([static_app, app])
         app = make_gzip_middleware(app, global_conf, compress_level=1)
 
+    # we want our low level middleware to get to the request ASAP. We don't
+    # need any pylons stack middleware in them
+    app = SimpleHg(app, config)
+    app = SimpleGit(app, config)
+
     app.config = config
 
     return app

rhodecode/config/routing.py

 """
 from __future__ import with_statement
 from routes import Mapper
-from rhodecode.lib.utils import check_repo_fast as cr
+
+
+# prefix for non repository related links needs to be prefixed with `/`
+ADMIN_PREFIX = '/_admin'
 
 
 def make_map(config):
                  always_scan=config['debug'])
     rmap.minimization = False
     rmap.explicit = False
-
+    
+    from rhodecode.lib.utils import is_valid_repo
+    from rhodecode.lib.utils import is_valid_repos_group
+    
     def check_repo(environ, match_dict):
         """
         check for valid repository for proper 404 handling
+        
         :param environ:
         :param match_dict:
         """
+         
         repo_name = match_dict.get('repo_name')
-        return not cr(repo_name, config['base_path'])
+        return is_valid_repo(repo_name, config['base_path'])
+
+    def check_group(environ, match_dict):
+        """
+        check for valid repositories group for proper 404 handling
+        
+        :param environ:
+        :param match_dict:
+        """
+        repos_group_name = match_dict.get('group_name')
+        
+        return is_valid_repos_group(repos_group_name, config['base_path'])
+
+
+    def check_int(environ, match_dict):
+        return match_dict.get('id').isdigit()
 
     # The ErrorController route (handles 404/500 error pages); it should
     # likely stay at the top, ensuring it can always be resolved
 
     #MAIN PAGE
     rmap.connect('home', '/', controller='home', action='index')
+    rmap.connect('repo_switcher', '/repos', controller='home',
+                 action='repo_switcher')
     rmap.connect('bugtracker',
                  "http://bitbucket.org/marcinkuzminski/rhodecode/issues",
                  _static=True)
     rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True)
 
     #ADMIN REPOSITORY REST ROUTES
-    with rmap.submapper(path_prefix='/_admin', controller='admin/repos') as m:
+    with rmap.submapper(path_prefix=ADMIN_PREFIX,
+                        controller='admin/repos') as m:
         m.connect("repos", "/repos",
              action="create", conditions=dict(method=["POST"]))
         m.connect("repos", "/repos",
         m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*}",
              action="delete_perm_user", conditions=dict(method=["DELETE"],
                                                         function=check_repo))
+        #ajax delete repo perm users_group
+        m.connect('delete_repo_users_group',
+                  "/repos_delete_users_group/{repo_name:.*}",
+                  action="delete_perm_users_group",
+                  conditions=dict(method=["DELETE"], function=check_repo))
+
         #settings actions
         m.connect('repo_stats', "/repos_stats/{repo_name:.*}",
              action="repo_stats", conditions=dict(method=["DELETE"],
         m.connect('repo_cache', "/repos_cache/{repo_name:.*}",
              action="repo_cache", conditions=dict(method=["DELETE"],
                                                         function=check_repo))
+        m.connect('repo_public_journal',
+                  "/repos_public_journal/{repo_name:.*}",
+                  action="repo_public_journal", conditions=dict(method=["PUT"],
+                  function=check_repo))
+        m.connect('repo_pull', "/repo_pull/{repo_name:.*}",
+             action="repo_pull", conditions=dict(method=["PUT"],
+                                                        function=check_repo))
+
+    with rmap.submapper(path_prefix=ADMIN_PREFIX,
+                        controller='admin/repos_groups') as m:
+        m.connect("repos_groups", "/repos_groups",
+                  action="create", conditions=dict(method=["POST"]))
+        m.connect("repos_groups", "/repos_groups",
+                  action="index", conditions=dict(method=["GET"]))
+        m.connect("formatted_repos_groups", "/repos_groups.{format}",
+                  action="index", conditions=dict(method=["GET"]))
+        m.connect("new_repos_group", "/repos_groups/new",
+                  action="new", conditions=dict(method=["GET"]))
+        m.connect("formatted_new_repos_group", "/repos_groups/new.{format}",
+                  action="new", conditions=dict(method=["GET"]))
+        m.connect("update_repos_group", "/repos_groups/{id}",
+                  action="update", conditions=dict(method=["PUT"],
+                                                   function=check_int))
+        m.connect("delete_repos_group", "/repos_groups/{id}",
+                  action="delete", conditions=dict(method=["DELETE"],
+                                                   function=check_int))
+        m.connect("edit_repos_group", "/repos_groups/{id}/edit",
+                  action="edit", conditions=dict(method=["GET"],
+                                                 function=check_int))
+        m.connect("formatted_edit_repos_group",
+                  "/repos_groups/{id}.{format}/edit",
+                  action="edit", conditions=dict(method=["GET"],
+                                                 function=check_int))
+        m.connect("repos_group", "/repos_groups/{id}",
+                  action="show", conditions=dict(method=["GET"],
+                                                 function=check_int))
+        m.connect("formatted_repos_group", "/repos_groups/{id}.{format}",
+                  action="show", conditions=dict(method=["GET"],
+                                                 function=check_int))
+
     #ADMIN USER REST ROUTES
-    rmap.resource('user', 'users', controller='admin/users',
-                  path_prefix='/_admin')
+    with rmap.submapper(path_prefix=ADMIN_PREFIX,
+                        controller='admin/users') as m:
+        m.connect("users", "/users",
+                  action="create", conditions=dict(method=["POST"]))
+        m.connect("users", "/users",
+                  action="index", conditions=dict(method=["GET"]))
+        m.connect("formatted_users", "/users.{format}",
+                  action="index", conditions=dict(method=["GET"]))
+        m.connect("new_user", "/users/new",
+                  action="new", conditions=dict(method=["GET"]))
+        m.connect("formatted_new_user", "/users/new.{format}",
+                  action="new", conditions=dict(method=["GET"]))
+        m.connect("update_user", "/users/{id}",
+                  action="update", conditions=dict(method=["PUT"]))
+        m.connect("delete_user", "/users/{id}",
+                  action="delete", conditions=dict(method=["DELETE"]))
+        m.connect("edit_user", "/users/{id}/edit",
+                  action="edit", conditions=dict(method=["GET"]))
+        m.connect("formatted_edit_user",
+                  "/users/{id}.{format}/edit",
+                  action="edit", conditions=dict(method=["GET"]))
+        m.connect("user", "/users/{id}",
+                  action="show", conditions=dict(method=["GET"]))
+        m.connect("formatted_user", "/users/{id}.{format}",
+                  action="show", conditions=dict(method=["GET"]))
+
+        #EXTRAS USER ROUTES
+        m.connect("user_perm", "/users_perm/{id}",
+                  action="update_perm", conditions=dict(method=["PUT"]))
+
+    #ADMIN USERS REST ROUTES
+    with rmap.submapper(path_prefix=ADMIN_PREFIX,
+                        controller='admin/users_groups') as m:
+        m.connect("users_groups", "/users_groups",
+                  action="create", conditions=dict(method=["POST"]))
+        m.connect("users_groups", "/users_groups",
+                  action="index", conditions=dict(method=["GET"]))
+        m.connect("formatted_users_groups", "/users_groups.{format}",
+                  action="index", conditions=dict(method=["GET"]))
+        m.connect("new_users_group", "/users_groups/new",
+                  action="new", conditions=dict(method=["GET"]))
+        m.connect("formatted_new_users_group", "/users_groups/new.{format}",
+                  action="new", conditions=dict(method=["GET"]))
+        m.connect("update_users_group", "/users_groups/{id}",
+                  action="update", conditions=dict(method=["PUT"]))
+        m.connect("delete_users_group", "/users_groups/{id}",
+                  action="delete", conditions=dict(method=["DELETE"]))
+        m.connect("edit_users_group", "/users_groups/{id}/edit",
+                  action="edit", conditions=dict(method=["GET"]))
+        m.connect("formatted_edit_users_group",
+                  "/users_groups/{id}.{format}/edit",
+                  action="edit", conditions=dict(method=["GET"]))
+        m.connect("users_group", "/users_groups/{id}",
+                  action="show", conditions=dict(method=["GET"]))
+        m.connect("formatted_users_group", "/users_groups/{id}.{format}",
+                  action="show", conditions=dict(method=["GET"]))
+
+        #EXTRAS USER ROUTES
+        m.connect("users_group_perm", "/users_groups_perm/{id}",
+                  action="update_perm", conditions=dict(method=["PUT"]))
+
+    #ADMIN GROUP REST ROUTES
+    rmap.resource('group', 'groups',
+                  controller='admin/groups', path_prefix=ADMIN_PREFIX)
 
     #ADMIN PERMISSIONS REST ROUTES
-    rmap.resource('permission', 'permissions', controller='admin/permissions',
-                  path_prefix='/_admin')
+    rmap.resource('permission', 'permissions',