[PATCH 3 of 3 V2] extensions: obsolete and remove interhg extension
Angel Ezquerra
angel.ezquerra at gmail.com
Sat Feb 9 09:19:45 CST 2013
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1360404042 -3600
# Node ID d9346075486b227a691fce6f69138c1b599c0cfe
# Parent ad4f7e5b4b23e34c81001d188bd82dcebc914dc8
extensions: obsolete and remove interhg extension
With the addition of the websub filter extension this extension is no longer
needed. We maintain a sort of backwards compatibility by reading the [interhg]
section and using it as we would use the [websub] section.
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -11,7 +11,7 @@
_extensions = {}
_order = []
-_ignore = ['hbisect', 'bookmarks', 'parentrevspec']
+_ignore = ['hbisect', 'bookmarks', 'parentrevspec', 'interhg']
def extensions():
for name in _order:
diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -8,6 +8,7 @@
import os
from mercurial import ui, hg, hook, error, encoding, templater, util, repoview
+from mercurial import extensions
from mercurial.templatefilters import websub
from mercurial.i18n import _
from common import get_stat, ErrorResponse, permhooks, caching
@@ -264,6 +265,8 @@
def loadwebsub(self):
websubtable = []
websubdefs = self.repo.ui.configitems('websub')
+ # we must maintain interhg backwards compatibility
+ websubdefs += self.repo.ui.configitems('interhg')
for key, pattern in websubdefs:
# grab the delimiter from the character after the "s"
unesc = pattern[1]
diff --git a/tests/test-interhg.t b/tests/test-websub.t
rename from tests/test-interhg.t
rename to tests/test-websub.t
--- a/tests/test-interhg.t
+++ b/tests/test-websub.t
@@ -5,11 +5,15 @@
$ cat > .hg/hgrc <<EOF
> [extensions]
+ > # this is only necessary to check that the mapping from
+ > # interhg to websub works
> interhg =
>
- > [interhg]
+ > [websub]
> issues = s|Issue(\d+)|<a href="http://bts.example.org/issue\1">Issue\1</a>|
>
+ > [interhg]
+ > # check that we maintain some interhg backwards compatibility...
> # yes, 'x' is a weird delimiter...
> markbugs = sxbugx<i class="\x">bug</i>x
> EOF
@@ -23,9 +27,8 @@
log
- $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '' | grep bts
- <td class="description"><a href="/rev/1b0e7ece6bd6"><a href="http://bts.example.org/issue123">Issue123</a>: fixed the <i class="x">bug</i>!</a><span class="branchhead">default</span> <span class="tag">tip</span> </td>
-
+ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT "rev/tip" | grep bts
+ <div class="description"><a href="http://bts.example.org/issue123">Issue123</a>: fixed the <i class="x">bug</i>!</div>
errors
$ cat errors.log
More information about the Mercurial-devel
mailing list