changeset 512:d945c95ba4ac

refactoring for new vcs implementation renamed all ._short and .raw_id into .short_id updated dependency for vcs to 0.1.6
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 28 Sep 2010 20:25:58 +0000
parents 0fce1f9e4dce
children 2fa16ec5822d
files celeryconfig.py pylons_app/controllers/changeset.py pylons_app/controllers/feed.py pylons_app/controllers/files.py pylons_app/lib/helpers.py pylons_app/model/hg_model.py pylons_app/templates/branches/branches_data.html pylons_app/templates/changelog/changelog.html pylons_app/templates/changeset/changeset.html pylons_app/templates/files/files_annotate.html pylons_app/templates/files/files_source.html pylons_app/templates/shortlog/shortlog_data.html pylons_app/templates/tags/tags_data.html setup.py
diffstat 14 files changed, 53 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/celeryconfig.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/celeryconfig.py	Tue Sep 28 20:25:58 2010 +0000
@@ -4,7 +4,7 @@
 import ConfigParser
 root = os.getcwd()
 
-PYLONS_CONFIG_NAME = 'development.ini'
+PYLONS_CONFIG_NAME = 'production.ini'
 
 sys.path.append(root)
 config = ConfigParser.ConfigParser({'here':root})
--- a/pylons_app/controllers/changeset.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/controllers/changeset.py	Tue Sep 28 20:25:58 2010 +0000
@@ -65,7 +65,7 @@
                     diff = differ.DiffProcessor(f_udiff).as_html()
 
                 cs1 = None
-                cs2 = node.last_changeset.raw_id                                        
+                cs2 = node.last_changeset.short_id                                        
                 c.changes.append(('added', node, diff, cs1, cs2))
                 
             for node in c.changeset.changed:
@@ -76,8 +76,8 @@
                     f_udiff = differ.get_udiff(filenode_old, node)
                     diff = differ.DiffProcessor(f_udiff).as_html()
 
-                cs1 = filenode_old.last_changeset.raw_id
-                cs2 = node.last_changeset.raw_id                    
+                cs1 = filenode_old.last_changeset.short_id
+                cs2 = node.last_changeset.short_id                    
                 c.changes.append(('changed', node, diff, cs1, cs2))
                 
             for node in c.changeset.removed:
@@ -110,7 +110,7 @@
                     diff = differ.DiffProcessor(f_udiff).raw_diff()
 
                 cs1 = None
-                cs2 = node.last_changeset.raw_id                                        
+                cs2 = node.last_changeset.short_id                                        
                 c.changes.append(('added', node, diff, cs1, cs2))
                 
             for node in c.changeset.changed:
@@ -121,8 +121,8 @@
                     f_udiff = differ.get_udiff(filenode_old, node)
                     diff = differ.DiffProcessor(f_udiff).raw_diff()
 
-                cs1 = filenode_old.last_changeset.raw_id
-                cs2 = node.last_changeset.raw_id                    
+                cs1 = filenode_old.last_changeset.short_id
+                cs2 = node.last_changeset.short_id                    
                 c.changes.append(('changed', node, diff, cs1, cs2))      
         
         response.content_type = 'text/plain'
--- a/pylons_app/controllers/feed.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/controllers/feed.py	Tue Sep 28 20:25:58 2010 +0000
@@ -54,7 +54,7 @@
         for cs in changesets[:self.feed_nr]:
             feed.add_item(title=cs.message,
                           link=url('changeset_home', repo_name=repo_name,
-                                   revision=cs.raw_id, qualified=True),
+                                   revision=cs.short_id, qualified=True),
                                    description=str(cs.date))
         
         response.content_type = feed.mime_type
@@ -73,7 +73,7 @@
         for cs in changesets[:self.feed_nr]:
             feed.add_item(title=cs.message,
                           link=url('changeset_home', repo_name=repo_name,
-                                   revision=cs.raw_id, qualified=True),
+                                   revision=cs.short_id, qualified=True),
                           description=str(cs.date))
             
         response.content_type = feed.mime_type
--- a/pylons_app/controllers/files.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/controllers/files.py	Tue Sep 28 20:25:58 2010 +0000
@@ -68,8 +68,8 @@
         
         try:
             cur_rev = repo.get_changeset(revision).revision
-            prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).raw_id
-            next_rev = repo.get_changeset(get_next_rev(cur_rev)).raw_id
+            prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).short_id
+            next_rev = repo.get_changeset(get_next_rev(cur_rev)).short_id
                     
             c.url_prev = url('files_home', repo_name=c.repo_name,
                              revision=prev_rev, f_path=f_path) 
@@ -78,7 +78,7 @@
                     
             c.changeset = repo.get_changeset(revision)
                         
-            c.cur_rev = c.changeset.raw_id
+            c.cur_rev = c.changeset.short_id
             c.rev_nr = c.changeset.revision
             c.files_list = c.changeset.get_node(f_path)
             c.file_history = self._get_history(repo, c.files_list, f_path)
@@ -111,7 +111,7 @@
         cs = c.repo.get_changeset(revision)
         c.file = cs.get_node(f_path)
         c.file_msg = cs.get_file_message(f_path)
-        c.cur_rev = cs.raw_id
+        c.cur_rev = cs.short_id
         c.rev_nr = cs.revision        
         c.f_path = f_path
 
@@ -171,8 +171,8 @@
             return redirect(url('files_home',
                                 repo_name=c.repo_name, f_path=f_path))
 
-        c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1.raw_id)
-        c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2.raw_id)
+        c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1.short_id)
+        c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2.short_id)
         f_udiff = differ.get_udiff(node1, node2)
         
         diff = differ.DiffProcessor(f_udiff)
@@ -202,6 +202,6 @@
         changesets = node.history
         hist_l = []
         for chs in changesets:
-            n_desc = 'r%s:%s' % (chs.revision, chs._short)
-            hist_l.append((chs._short, n_desc,))
+            n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
+            hist_l.append((chs.short_id, n_desc,))
         return hist_l
--- a/pylons_app/lib/helpers.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/lib/helpers.py	Tue Sep 28 20:25:58 2010 +0000
@@ -271,12 +271,12 @@
                                                changeset.date,
                                                tooltip(changeset.message))
         lnk_format = 'r%-5s:%s' % (changeset.revision,
-                                 changeset.raw_id)
+                                 changeset.short_id)
         uri = link_to(
                 lnk_format,
                 url('changeset_home', repo_name=changeset.repository.name,
-                    revision=changeset.raw_id),
-                style=get_color_string(changeset.raw_id),
+                    revision=changeset.short_id),
+                style=get_color_string(changeset.short_id),
                 class_='tooltip',
                 tooltip_title=tooltip_html
               )
--- a/pylons_app/model/hg_model.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/model/hg_model.py	Tue Sep 28 20:25:58 2010 +0000
@@ -155,7 +155,7 @@
             tmp_d['description_sort'] = tmp_d['description']
             tmp_d['last_change'] = last_change
             tmp_d['last_change_sort'] = last_change[1] - last_change[0]
-            tmp_d['tip'] = tip.raw_id
+            tmp_d['tip'] = tip.short_id
             tmp_d['tip_sort'] = tip.revision 
             tmp_d['rev'] = tip.revision
             tmp_d['contact'] = repo.contact
--- a/pylons_app/templates/branches/branches_data.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/branches/branches_data.html	Tue Sep 28 20:25:58 2010 +0000
@@ -9,17 +9,17 @@
 		%for cnt,branch in enumerate(c.repo_branches.items()):
 		<tr class="parity${cnt%2}">
 			<td>${h.age(branch[1]._ctx.date())}</td>
-			<td>r${branch[1].revision}:${branch[1].raw_id}</td>
+			<td>r${branch[1].revision}:${branch[1].short_id}</td>
 			<td>
 				<span class="logtags">
 					<span class="branchtag">${h.link_to(branch[0],
-					h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
+					h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}</span>
 				</span>			
 			</td>
 			<td class="nowrap">
-			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
+			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}
 			|
-			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
+			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].short_id))}
 			</td>
 		</tr>	
 		%endfor
--- a/pylons_app/templates/changelog/changelog.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/changelog/changelog.html	Tue Sep 28 20:25:58 2010 +0000
@@ -46,7 +46,7 @@
 				%for cnt,cs in enumerate(c.pagination):
 					<div id="chg_${cnt+1}" class="container">
 						<div class="left">
-							<div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div>
+							<div class="date">${_('commit')} ${cs.revision}: ${cs.short_id}@${cs.date}</div>
 								<span class="logtags">
 									<span class="branchtag">${cs.branch}</span>
 									%for tag in cs.tags:
@@ -62,7 +62,7 @@
 							</div>
 							<div class="message">
 								${h.link_to(h.wrap_paragraphs(cs.message),
-								h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
+								h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id))}
 							</div>
 						</div>	
 						<div class="right">
@@ -77,8 +77,8 @@
 										</div>
 										%endif						
 									%for p_cs in reversed(cs.parents):
-										<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
-											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
+										<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
+											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
 										</div>
 									%endfor								
 						</div>				
--- a/pylons_app/templates/changeset/changeset.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/changeset/changeset.html	Tue Sep 28 20:25:58 2010 +0000
@@ -9,7 +9,7 @@
     &raquo;
     ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
     &raquo;
-    ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id}
+    ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
 </%def>
 
 <%def name="page_nav()">
@@ -26,11 +26,11 @@
 		<div id="body" class="diffblock">
 			<div class="code-header">
 				<div>
-				${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id}
+				${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
 				 &raquo; <span>${h.link_to(_('raw diff'),
-				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span>
+				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='show'))}</span>
 				 &raquo; <span>${h.link_to(_('download diff'),
-				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span>
+				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='download'))}</span>
 				</div>
 			</div>
 		</div>
@@ -56,8 +56,8 @@
 				</div>
 				%endif						
 				%for p_cs in reversed(c.changeset.parents):
-					<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
-						h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
+					<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
+						h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
 					</div>
 				%endfor								
 			</div>		
@@ -78,7 +78,7 @@
 				<div>
 					<span>
 						${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
-						revision=filenode.changeset.raw_id,f_path=filenode.path))}
+						revision=filenode.changeset.short_id,f_path=filenode.path))}
 					</span>
 					%if 1:
 					&raquo; <span>${h.link_to(_('diff'),
--- a/pylons_app/templates/files/files_annotate.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/files/files_annotate.html	Tue Sep 28 20:25:58 2010 +0000
@@ -26,8 +26,8 @@
 			<h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.file.path)}</h3>
 			<dl class="overview">
 				<dt>${_('Last revision')}</dt>
-				<dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset._short),
-						h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset._short,f_path=c.f_path))} </dd>
+				<dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset.short_id),
+						h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.short_id,f_path=c.f_path))} </dd>
 				<dt>${_('Size')}</dt>
 				<dd>${h.format_byte_size(c.file.size,binary=True)}</dd>
     			<dt>${_('Mimetype')}</dt>
@@ -43,7 +43,7 @@
 			</dl>
 			<div id="body" class="codeblock">
 				<div class="code-header">
-					<div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset._short}</div>
+					<div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset.short_id}</div>
 					<div class="commit">"${c.file_msg}"</div>
 				</div>
 				<div class="code-body">
--- a/pylons_app/templates/files/files_source.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/files/files_source.html	Tue Sep 28 20:25:58 2010 +0000
@@ -1,8 +1,8 @@
 <dl>
 	<dt>${_('Last revision')}</dt>
 	<dd>
-		${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset._short),
-						h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset._short,f_path=c.f_path))} 
+		${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset.short_id),
+						h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.short_id,f_path=c.f_path))} 
 	</dd>
 	<dt>${_('Size')}</dt>
 	<dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
@@ -20,8 +20,8 @@
 	<dd>
 		<div>
 		${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
-		${h.hidden('diff2',c.files_list.last_changeset._short)}
-		${h.select('diff1',c.files_list.last_changeset._short,c.file_history)}
+		${h.hidden('diff2',c.files_list.last_changeset.short_id)}
+		${h.select('diff1',c.files_list.last_changeset.short_id,c.file_history)}
 		${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
 		${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
 		${h.end_form()}
@@ -32,7 +32,7 @@
 	
 <div id="body" class="codeblock">
 	<div class="code-header">
-		<div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</div>
+		<div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset.short_id}</div>
 		<div class="commit">"${c.files_list.last_changeset.message}"</div>
 	</div>
 	<div class="code-body">
--- a/pylons_app/templates/shortlog/shortlog_data.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/shortlog/shortlog_data.html	Tue Sep 28 20:25:58 2010 +0000
@@ -15,10 +15,10 @@
 	<tr class="parity${cnt%2}">
 		<td>${h.age(cs._ctx.date())} - ${h.rfc822date_notz(cs._ctx.date())} </td>
 		<td title="${cs.author}">${h.person(cs.author)}</td>
-		<td>r${cs.revision}:${cs.raw_id}</td>
+		<td>r${cs.revision}:${cs.short_id}</td>
 		<td>
 			${h.link_to(h.truncate(cs.message,60),
-			h.url('changeset_home',repo_name=c.repo_name,revision=cs._short),
+			h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id),
 			title=cs.message)}
 		</td>
 		<td>
@@ -34,9 +34,9 @@
 			</span>
 		</td>
 		<td class="nowrap">
-		${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
+		${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id))}
 		|
-		${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
+		${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}
 		</td>
 	</tr>
 %endfor
--- a/pylons_app/templates/tags/tags_data.html	Tue Sep 28 20:14:16 2010 +0000
+++ b/pylons_app/templates/tags/tags_data.html	Tue Sep 28 20:25:58 2010 +0000
@@ -9,17 +9,17 @@
 		%for cnt,tag in enumerate(c.repo_tags.items()):
 		<tr class="parity${cnt%2}">
 			<td>${h.age(tag[1]._ctx.date())}</td>
-			<td>r${tag[1].revision}:${tag[1].raw_id}</td>
+			<td>r${tag[1].revision}:${tag[1].short_id}</td>
 			<td>
 				<span class="logtags">
 					<span class="tagtag">${h.link_to(tag[0],
-					h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
+					h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}</span>
 				</span>
 			</td>
 			<td class="nowrap">
-			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
+			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}
 			|
-			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
+			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].short_id))}
 			</td>
 		</tr>	
 		%endfor
--- a/setup.py	Tue Sep 28 20:14:16 2010 +0000
+++ b/setup.py	Tue Sep 28 20:25:58 2010 +0000
@@ -20,7 +20,7 @@
         "SQLAlchemy>=0.6",
         "babel",
         "Mako>=0.3.2",
-        "vcs>=0.1.5",
+        "vcs>=0.1.6",
         "pygments>=1.3.0",
         "mercurial>=1.6",
         "pysqlite",