Patchwork [3,of,3,V3] extensions: obsolete and remove interhg extension

login
register
mail settings
Submitter Angel Ezquerra
Date Feb. 10, 2013, 12:21 p.m.
Message ID <8c8f60f3245521457928.1360498887@Angel-PC.localdomain>
Download mbox | patch
Permalink /patch/929/
State Accepted
Commit 013fcd112f13f31a35ea6a40d8cd1c6923cdaf20
Headers show

Comments

Angel Ezquerra - Feb. 10, 2013, 12:21 p.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1360404042 -3600
# Node ID 8c8f60f32455214579282ba2d67e36b704227455
# Parent  f9bee14db21432fa90dd2c10cd6880286946d917
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.
Matt Mackall - Feb. 10, 2013, 5:18 p.m.
On Sun, 2013-02-10 at 13:21 +0100, Angel Ezquerra wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra@gmail.com>
> # Date 1360404042 -3600
> # Node ID 8c8f60f32455214579282ba2d67e36b704227455
> # Parent  f9bee14db21432fa90dd2c10cd6880286946d917
> extensions: obsolete and remove interhg extension

These are applied to default, thanks.

Patch

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
@@ -264,6 +264,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