diff rhodecode/controllers/summary.py @ 1813:a8c66e870bd0 beta

implements #285: Implemented non changeable urls for clone url, and web views
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 29 Dec 2011 00:01:05 +0200
parents 1635a21485d6
children cf51bbfb120e
line wrap: on
line diff
--- a/rhodecode/controllers/summary.py	Wed Dec 28 23:57:57 2011 +0200
+++ b/rhodecode/controllers/summary.py	Thu Dec 29 00:01:05 2011 +0200
@@ -92,13 +92,20 @@
         uri_tmpl = config.get('clone_uri', default_clone_uri)
         uri_tmpl = uri_tmpl.replace('{', '%(').replace('}', ')s')
 
-        uri = uri_tmpl % {'user': username,
-                           'pass': password,
-                           'scheme': parsed_url.scheme,
-                           'netloc': parsed_url.netloc,
-                           'path':parsed_url.path}
+        uri_dict = {
+           'user': username,
+           'pass': password,
+           'scheme': parsed_url.scheme,
+           'netloc': parsed_url.netloc,
+           'path': parsed_url.path
+        }
+        uri = uri_tmpl % uri_dict
+        # generate another clone url by id
+        uri_dict.update({'path': '/_%s' % c.dbrepo.repo_id})
+        uri_id = uri_tmpl % uri_dict
 
         c.clone_repo_url = uri
+        c.clone_repo_url_id = uri_id
         c.repo_tags = OrderedDict()
         for name, hash in c.rhodecode_repo.tags.items()[:10]:
             try: