1. June Rhodes
  2. RhodeCode

Commits

Marcin Kuzminski  committed d945c95

refactoring for new vcs implementation
renamed all ._short and .raw_id into .short_id
updated dependency for vcs to 0.1.6

  • Participants
  • Parent commits 0fce1f9
  • Branches default

Comments (0)

Files changed (14)

File celeryconfig.py

View file
 import ConfigParser
 root = os.getcwd()
 
-PYLONS_CONFIG_NAME = 'development.ini'
+PYLONS_CONFIG_NAME = 'production.ini'
 
 sys.path.append(root)
 config = ConfigParser.ConfigParser({'here':root})

File pylons_app/controllers/changeset.py

View file
                     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:
                     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:
                     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:
                     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'

File pylons_app/controllers/feed.py

View file
         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
         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

File pylons_app/controllers/files.py

View file
         
         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) 
                     
             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)
         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
 
             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)
         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

File pylons_app/lib/helpers.py

View file
                                                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
               )

File pylons_app/model/hg_model.py

View file
             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

File pylons_app/templates/branches/branches_data.html

View file
 		%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

File pylons_app/templates/changelog/changelog.html

View file
 				%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:
 							</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">
 										</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>				

File pylons_app/templates/changeset/changeset.html

View file
     &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()">
 		<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>
 				</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>		
 				<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'),

File pylons_app/templates/files/files_annotate.html

View file
 			<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>
 			</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">

File pylons_app/templates/files/files_source.html

View file
 <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>
 	<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()}
 	
 <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">

File pylons_app/templates/shortlog/shortlog_data.html

View file
 	<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>
 			</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

File pylons_app/templates/tags/tags_data.html

View file
 		%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

File setup.py

View file
         "SQLAlchemy>=0.6",
         "babel",
         "Mako>=0.3.2",
-        "vcs>=0.1.5",
+        "vcs>=0.1.6",
         "pygments>=1.3.0",
         "mercurial>=1.6",
         "pysqlite",