Commits

WAKAYAMA shirou committed f3d7513

move to under the sphinxcontrib directory and rename to hg_changelog.

  • Participants
  • Parent commits 4b25a8e

Comments (0)

Files changed (3)

File sphinx_hg.py

-# -*- coding: utf-8-unix -*-
-# Copyright 2012 (C) Takayuki KONDO <tkondou@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from docutils import nodes
-from sphinx.util.compat import Directive
-
-from mercurial import ui, hg, util
-
-class HgChangeLog(Directive):
-
-    def run(self):
-        repo = hg.repository(ui.ui(), ".") # current repository
-        l = nodes.bullet_list()
-
-        commits = range(repo.changectx("tip").rev()+1)
-        commits.reverse()
-        for commit in commits[:10]:
-            ctx = repo.changectx(commit)
-            item = nodes.list_item()
-            item += [ nodes.strong(text=ctx.description()),
-                      nodes.inline(text=" by "),
-                      nodes.emphasis(text=ctx.user()),
-                      nodes.inline(text=" at "),
-                      nodes.emphasis(text=util.datestr(ctx.date()))
-                      ]
-            l.append(item)
-        return [l]
-
-def setup(app):
-    app.add_directive('hg_changelog', HgChangeLog)

File sphinxcontrib/__init__.py

+# -*- coding: utf-8 -*-
+"""
+    sphinxcontrib
+    ~~~~~~~~~~~~~
+
+    This package is a namespace package that contains all extensions
+    distributed in the ``sphinx-contrib`` distribution.
+
+    :copyright: Copyright 2007-2012 by the Sphinx team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+__import__('pkg_resources').declare_namespace(__name__)

File sphinxcontrib/hg_changelog.py

+# -*- coding: utf-8-unix -*-
+# Copyright 2012 (C) Takayuki KONDO <tkondou@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from docutils import nodes
+from sphinx.util.compat import Directive
+
+from mercurial import ui, hg, util
+
+class HgChangeLog(Directive):
+
+    def run(self):
+        repo = hg.repository(ui.ui(), ".") # current repository
+        l = nodes.bullet_list()
+
+        commits = range(repo.changectx("tip").rev()+1)
+        commits.reverse()
+
+        for commit in commits[:max_commits]:
+            ctx = repo.changectx(commit)
+            item = nodes.list_item()
+            item += [ nodes.strong(text=ctx.description()),
+                      nodes.inline(text=" by "),
+                      nodes.emphasis(text=ctx.user()),
+                      nodes.inline(text=" at "),
+                      nodes.emphasis(text=util.datestr(ctx.date()))
+                      ]
+            l.append(item)
+        return [l]
+
+def setup(app):
+    app.add_directive('hg_changelog', HgChangeLog)