Commits

Dirkjan Ochtman committed 9ef3d9e

Simplify wiki formatter.

Comments (0)

Files changed (1)

hgtl/changelog.py

 			yield (repo, self._format_link)
 	
 	def _format_link(self, formatter, ns, rev, label):
+		href = '%s/%s/rev/%s' % (self.web_href, ns, rev)
 		try:
-			n = self.get_node(ns, rev)
-			data = self.get_changeset(ns, n)
-			return tag.a(label, class_ = 'changeset',
-						 title = shorten_line(data[4]),
-						 href = self.rev_link(ns, n))
+			ctx = hg.repository(self.ui, self.rpaths[ns])[rev]
+			text = shorten_line(to_unicode(ctx.description()))
+			return tag.a(label, class_='changeset', href=href, title=text)
 		except NoSuchChangeset, e:
-			return tag.a(label, class_ = 'missing changeset',
-						 title = to_unicode(e), rel = 'nofollow',
-						 href = self.rev_link(ns, rev))
+			return tag.a(label, class_='missing changeset', rel='nofollow',
+						 href=href, title=to_unicode(e))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.