##// END OF EJS Templates
refactoring for new vcs implementation...
marcink -
r512:d945c95b default
parent child Browse files
Show More
@@ -4,7 +4,7 b' import os'
4 4 import ConfigParser
5 5 root = os.getcwd()
6 6
7 PYLONS_CONFIG_NAME = 'development.ini'
7 PYLONS_CONFIG_NAME = 'production.ini'
8 8
9 9 sys.path.append(root)
10 10 config = ConfigParser.ConfigParser({'here':root})
@@ -65,7 +65,7 b' class ChangesetController(BaseController'
65 65 diff = differ.DiffProcessor(f_udiff).as_html()
66 66
67 67 cs1 = None
68 cs2 = node.last_changeset.raw_id
68 cs2 = node.last_changeset.short_id
69 69 c.changes.append(('added', node, diff, cs1, cs2))
70 70
71 71 for node in c.changeset.changed:
@@ -76,8 +76,8 b' class ChangesetController(BaseController'
76 76 f_udiff = differ.get_udiff(filenode_old, node)
77 77 diff = differ.DiffProcessor(f_udiff).as_html()
78 78
79 cs1 = filenode_old.last_changeset.raw_id
80 cs2 = node.last_changeset.raw_id
79 cs1 = filenode_old.last_changeset.short_id
80 cs2 = node.last_changeset.short_id
81 81 c.changes.append(('changed', node, diff, cs1, cs2))
82 82
83 83 for node in c.changeset.removed:
@@ -110,7 +110,7 b' class ChangesetController(BaseController'
110 110 diff = differ.DiffProcessor(f_udiff).raw_diff()
111 111
112 112 cs1 = None
113 cs2 = node.last_changeset.raw_id
113 cs2 = node.last_changeset.short_id
114 114 c.changes.append(('added', node, diff, cs1, cs2))
115 115
116 116 for node in c.changeset.changed:
@@ -121,8 +121,8 b' class ChangesetController(BaseController'
121 121 f_udiff = differ.get_udiff(filenode_old, node)
122 122 diff = differ.DiffProcessor(f_udiff).raw_diff()
123 123
124 cs1 = filenode_old.last_changeset.raw_id
125 cs2 = node.last_changeset.raw_id
124 cs1 = filenode_old.last_changeset.short_id
125 cs2 = node.last_changeset.short_id
126 126 c.changes.append(('changed', node, diff, cs1, cs2))
127 127
128 128 response.content_type = 'text/plain'
@@ -54,7 +54,7 b' class FeedController(BaseController):'
54 54 for cs in changesets[:self.feed_nr]:
55 55 feed.add_item(title=cs.message,
56 56 link=url('changeset_home', repo_name=repo_name,
57 revision=cs.raw_id, qualified=True),
57 revision=cs.short_id, qualified=True),
58 58 description=str(cs.date))
59 59
60 60 response.content_type = feed.mime_type
@@ -73,7 +73,7 b' class FeedController(BaseController):'
73 73 for cs in changesets[:self.feed_nr]:
74 74 feed.add_item(title=cs.message,
75 75 link=url('changeset_home', repo_name=repo_name,
76 revision=cs.raw_id, qualified=True),
76 revision=cs.short_id, qualified=True),
77 77 description=str(cs.date))
78 78
79 79 response.content_type = feed.mime_type
@@ -68,8 +68,8 b' class FilesController(BaseController):'
68 68
69 69 try:
70 70 cur_rev = repo.get_changeset(revision).revision
71 prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).raw_id
72 next_rev = repo.get_changeset(get_next_rev(cur_rev)).raw_id
71 prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).short_id
72 next_rev = repo.get_changeset(get_next_rev(cur_rev)).short_id
73 73
74 74 c.url_prev = url('files_home', repo_name=c.repo_name,
75 75 revision=prev_rev, f_path=f_path)
@@ -78,7 +78,7 b' class FilesController(BaseController):'
78 78
79 79 c.changeset = repo.get_changeset(revision)
80 80
81 c.cur_rev = c.changeset.raw_id
81 c.cur_rev = c.changeset.short_id
82 82 c.rev_nr = c.changeset.revision
83 83 c.files_list = c.changeset.get_node(f_path)
84 84 c.file_history = self._get_history(repo, c.files_list, f_path)
@@ -111,7 +111,7 b' class FilesController(BaseController):'
111 111 cs = c.repo.get_changeset(revision)
112 112 c.file = cs.get_node(f_path)
113 113 c.file_msg = cs.get_file_message(f_path)
114 c.cur_rev = cs.raw_id
114 c.cur_rev = cs.short_id
115 115 c.rev_nr = cs.revision
116 116 c.f_path = f_path
117 117
@@ -171,8 +171,8 b' class FilesController(BaseController):'
171 171 return redirect(url('files_home',
172 172 repo_name=c.repo_name, f_path=f_path))
173 173
174 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1.raw_id)
175 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2.raw_id)
174 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1.short_id)
175 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2.short_id)
176 176 f_udiff = differ.get_udiff(node1, node2)
177 177
178 178 diff = differ.DiffProcessor(f_udiff)
@@ -202,6 +202,6 b' class FilesController(BaseController):'
202 202 changesets = node.history
203 203 hist_l = []
204 204 for chs in changesets:
205 n_desc = 'r%s:%s' % (chs.revision, chs._short)
206 hist_l.append((chs._short, n_desc,))
205 n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
206 hist_l.append((chs.short_id, n_desc,))
207 207 return hist_l
@@ -271,12 +271,12 b' def pygmentize_annotation(filenode, **kw'
271 271 changeset.date,
272 272 tooltip(changeset.message))
273 273 lnk_format = 'r%-5s:%s' % (changeset.revision,
274 changeset.raw_id)
274 changeset.short_id)
275 275 uri = link_to(
276 276 lnk_format,
277 277 url('changeset_home', repo_name=changeset.repository.name,
278 revision=changeset.raw_id),
279 style=get_color_string(changeset.raw_id),
278 revision=changeset.short_id),
279 style=get_color_string(changeset.short_id),
280 280 class_='tooltip',
281 281 tooltip_title=tooltip_html
282 282 )
@@ -155,7 +155,7 b' class HgModel(object):'
155 155 tmp_d['description_sort'] = tmp_d['description']
156 156 tmp_d['last_change'] = last_change
157 157 tmp_d['last_change_sort'] = last_change[1] - last_change[0]
158 tmp_d['tip'] = tip.raw_id
158 tmp_d['tip'] = tip.short_id
159 159 tmp_d['tip_sort'] = tip.revision
160 160 tmp_d['rev'] = tip.revision
161 161 tmp_d['contact'] = repo.contact
@@ -9,17 +9,17 b''
9 9 %for cnt,branch in enumerate(c.repo_branches.items()):
10 10 <tr class="parity${cnt%2}">
11 11 <td>${h.age(branch[1]._ctx.date())}</td>
12 <td>r${branch[1].revision}:${branch[1].raw_id}</td>
12 <td>r${branch[1].revision}:${branch[1].short_id}</td>
13 13 <td>
14 14 <span class="logtags">
15 15 <span class="branchtag">${h.link_to(branch[0],
16 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
16 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}</span>
17 17 </span>
18 18 </td>
19 19 <td class="nowrap">
20 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
20 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}
21 21 |
22 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
22 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].short_id))}
23 23 </td>
24 24 </tr>
25 25 %endfor
@@ -46,7 +46,7 b''
46 46 %for cnt,cs in enumerate(c.pagination):
47 47 <div id="chg_${cnt+1}" class="container">
48 48 <div class="left">
49 <div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div>
49 <div class="date">${_('commit')} ${cs.revision}: ${cs.short_id}@${cs.date}</div>
50 50 <span class="logtags">
51 51 <span class="branchtag">${cs.branch}</span>
52 52 %for tag in cs.tags:
@@ -62,7 +62,7 b''
62 62 </div>
63 63 <div class="message">
64 64 ${h.link_to(h.wrap_paragraphs(cs.message),
65 h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
65 h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id))}
66 66 </div>
67 67 </div>
68 68 <div class="right">
@@ -77,8 +77,8 b''
77 77 </div>
78 78 %endif
79 79 %for p_cs in reversed(cs.parents):
80 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
81 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
80 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
81 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
82 82 </div>
83 83 %endfor
84 84 </div>
@@ -9,7 +9,7 b''
9 9 &raquo;
10 10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
11 11 &raquo;
12 ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id}
12 ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
13 13 </%def>
14 14
15 15 <%def name="page_nav()">
@@ -26,11 +26,11 b''
26 26 <div id="body" class="diffblock">
27 27 <div class="code-header">
28 28 <div>
29 ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id}
29 ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
30 30 &raquo; <span>${h.link_to(_('raw diff'),
31 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span>
31 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='show'))}</span>
32 32 &raquo; <span>${h.link_to(_('download diff'),
33 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span>
33 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='download'))}</span>
34 34 </div>
35 35 </div>
36 36 </div>
@@ -56,8 +56,8 b''
56 56 </div>
57 57 %endif
58 58 %for p_cs in reversed(c.changeset.parents):
59 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
60 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
59 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
60 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
61 61 </div>
62 62 %endfor
63 63 </div>
@@ -78,7 +78,7 b''
78 78 <div>
79 79 <span>
80 80 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
81 revision=filenode.changeset.raw_id,f_path=filenode.path))}
81 revision=filenode.changeset.short_id,f_path=filenode.path))}
82 82 </span>
83 83 %if 1:
84 84 &raquo; <span>${h.link_to(_('diff'),
@@ -26,8 +26,8 b''
26 26 <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.file.path)}</h3>
27 27 <dl class="overview">
28 28 <dt>${_('Last revision')}</dt>
29 <dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset._short),
30 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset._short,f_path=c.f_path))} </dd>
29 <dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset.short_id),
30 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.short_id,f_path=c.f_path))} </dd>
31 31 <dt>${_('Size')}</dt>
32 32 <dd>${h.format_byte_size(c.file.size,binary=True)}</dd>
33 33 <dt>${_('Mimetype')}</dt>
@@ -43,7 +43,7 b''
43 43 </dl>
44 44 <div id="body" class="codeblock">
45 45 <div class="code-header">
46 <div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset._short}</div>
46 <div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset.short_id}</div>
47 47 <div class="commit">"${c.file_msg}"</div>
48 48 </div>
49 49 <div class="code-body">
@@ -1,8 +1,8 b''
1 1 <dl>
2 2 <dt>${_('Last revision')}</dt>
3 3 <dd>
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset._short),
5 h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset._short,f_path=c.f_path))}
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset.short_id),
5 h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.short_id,f_path=c.f_path))}
6 6 </dd>
7 7 <dt>${_('Size')}</dt>
8 8 <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
@@ -20,8 +20,8 b''
20 20 <dd>
21 21 <div>
22 22 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
23 ${h.hidden('diff2',c.files_list.last_changeset._short)}
24 ${h.select('diff1',c.files_list.last_changeset._short,c.file_history)}
23 ${h.hidden('diff2',c.files_list.last_changeset.short_id)}
24 ${h.select('diff1',c.files_list.last_changeset.short_id,c.file_history)}
25 25 ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
26 26 ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
27 27 ${h.end_form()}
@@ -32,7 +32,7 b''
32 32
33 33 <div id="body" class="codeblock">
34 34 <div class="code-header">
35 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</div>
35 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset.short_id}</div>
36 36 <div class="commit">"${c.files_list.last_changeset.message}"</div>
37 37 </div>
38 38 <div class="code-body">
@@ -15,10 +15,10 b''
15 15 <tr class="parity${cnt%2}">
16 16 <td>${h.age(cs._ctx.date())} - ${h.rfc822date_notz(cs._ctx.date())} </td>
17 17 <td title="${cs.author}">${h.person(cs.author)}</td>
18 <td>r${cs.revision}:${cs.raw_id}</td>
18 <td>r${cs.revision}:${cs.short_id}</td>
19 19 <td>
20 20 ${h.link_to(h.truncate(cs.message,60),
21 h.url('changeset_home',repo_name=c.repo_name,revision=cs._short),
21 h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id),
22 22 title=cs.message)}
23 23 </td>
24 24 <td>
@@ -34,9 +34,9 b''
34 34 </span>
35 35 </td>
36 36 <td class="nowrap">
37 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
37 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id))}
38 38 |
39 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
39 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}
40 40 </td>
41 41 </tr>
42 42 %endfor
@@ -9,17 +9,17 b''
9 9 %for cnt,tag in enumerate(c.repo_tags.items()):
10 10 <tr class="parity${cnt%2}">
11 11 <td>${h.age(tag[1]._ctx.date())}</td>
12 <td>r${tag[1].revision}:${tag[1].raw_id}</td>
12 <td>r${tag[1].revision}:${tag[1].short_id}</td>
13 13 <td>
14 14 <span class="logtags">
15 15 <span class="tagtag">${h.link_to(tag[0],
16 h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
16 h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}</span>
17 17 </span>
18 18 </td>
19 19 <td class="nowrap">
20 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
20 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}
21 21 |
22 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
22 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].short_id))}
23 23 </td>
24 24 </tr>
25 25 %endfor
@@ -20,7 +20,7 b' setup('
20 20 "SQLAlchemy>=0.6",
21 21 "babel",
22 22 "Mako>=0.3.2",
23 "vcs>=0.1.5",
23 "vcs>=0.1.6",
24 24 "pygments>=1.3.0",
25 25 "mercurial>=1.6",
26 26 "pysqlite",
General Comments 0
You need to be logged in to leave comments. Login now