changeset 405:b5b1bf5166a2

obsolete: enable obsolete feature The feature is now disabled by default in core.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 31 Jul 2012 12:45:24 +0200
parents c2ef47fce3f9
children 9fcbe7c47939
files hgext/obsolete.py tests/test-obsolete.t
diffstat 2 files changed, 33 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/obsolete.py	Mon Jul 30 14:45:42 2012 +0200
+++ b/hgext/obsolete.py	Tue Jul 31 12:45:24 2012 +0200
@@ -75,6 +75,8 @@
 from mercurial import localrepo
 from mercurial import cmdutil
 from mercurial import templatekw
+from mercurial import obsolete
+setattr(obsolete, '_enabled', True)
 
 try:
     from mercurial.localrepo import storecache
--- a/tests/test-obsolete.t	Mon Jul 30 14:45:42 2012 +0200
+++ b/tests/test-obsolete.t	Tue Jul 31 12:45:24 2012 +0200
@@ -278,35 +278,37 @@
 
 pushing to stuff that doesn't support obsolete
 
-  $ hg init ../other-old
-  > # XXX I don't like this but changeset get published otherwise
-  > # remove it when we will get a --keep-state flag for push
-  $ echo '[extensions]'  > ../other-old/.hg/hgrc
-  $ echo "obsolete=!$(echo $(dirname $TESTDIR))/obsolete.py" >> ../other-old/.hg/hgrc
-  $ hg push ../other-old
-  pushing to ../other-old
-  searching for changes
-  abort: push includes an unstable changeset: 909a0fb57e5d!
-  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
-  [255]
-  $ hg push -f ../other-old
-  pushing to ../other-old
-  searching for changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 5 changesets with 5 changes to 5 files (+1 heads)
-  $ qlog -R ../other-old
-  4
-  - 909a0fb57e5d
-  3
-  - 725c380fe99b
-  2
-  - 0d3f46688ccc
-  1
-  - 7c3bad9141dc
-  0
-  - 1f0dee641bb7
+DISABLED. the _enable switch it global :-/
+
+..  $ hg init ../other-old
+..  > # XXX I don't like this but changeset get published otherwise
+..  > # remove it when we will get a --keep-state flag for push
+..  $ echo '[extensions]'  > ../other-old/.hg/hgrc
+..  $ echo "obsolete=!$(echo $(dirname $TESTDIR))/obsolete.py" >> ../other-old/.hg/hgrc
+..  $ hg push ../other-old
+..  pushing to ../other-old
+..  searching for changes
+..  abort: push includes an unstable changeset: 909a0fb57e5d!
+..  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+..  [255]
+..  $ hg push -f ../other-old
+..  pushing to ../other-old
+..  searching for changes
+..  adding changesets
+..  adding manifests
+..  adding file changes
+..  added 5 changesets with 5 changes to 5 files (+1 heads)
+..  $ qlog -R ../other-ol
+..  4
+..  - 909a0fb57e5d
+..  3
+..  - 725c380fe99b
+..  2
+..  - 0d3f46688ccc
+..  1
+..  - 7c3bad9141dc
+..  0
+..  - 1f0dee641bb7
 
 clone support