- @with_working_copy_locked
- def open_page(self, title):
- if title not in self:
- raise DocumentNotFound()
-
- path = self._title_to_file(title)
- logger.debug("Opening page %s", path)
+# @with_working_copy_locked
+# def _open_page(self, title):
+# if title not in self:
+# raise DocumentNotFound()
+#
+# path = self._title_to_file(title)
+# logger.debug("Opening page %s", path)
+# try:
+# return self.repo.wfile(path, 'rb')
+# except IOError:
+# logger.exception("Failed to open page %s", title)
+# raise DocumentNotFound()
+
+ def page_text(self, title, revision=None):
+ """Read unicode text of a page."""
+ ctx = self._find_filectx(title, revision)
+ return ctx.data().decode(self.charset, 'replace'), ctx.filerev()
+
+ def page_text_by_tag(self, title, tag):
+ """Read unicode text of a taged page."""
+ tag = u"{title}#{tag}".format(**locals()).encode('utf-8')
+ fname = self._title_to_file(title)
+