# HG changeset patch # User Pierre-Yves David # Date 1343473525 -7200 # Node ID 6955d69a52a46b34351d7d8b4709eb861d006d47 # Parent a1f8869f2eee0888b44785f9dae98e486881d7b2 obsolete: warns if markers exist in a repo where the feature is not enabled We don't simply abort to allow the user to run other diagnostic commands. diff -r a1f8869f2eee -r 6955d69a52a4 mercurial/localrepo.py --- a/mercurial/localrepo.py Sat Jul 28 13:19:06 2012 +0200 +++ b/mercurial/localrepo.py Sat Jul 28 13:05:25 2012 +0200 @@ -289,6 +289,10 @@ @storecache('obsstore') def obsstore(self): store = obsolete.obsstore(self.sopener) + if store and not obsolete._enabled: + # message is rare enough to not be stranlated + msg = 'obsolete feature not enabled but %i markers found!\n' + self.ui.warn(msg % len(list(store))) return store @propertycache diff -r a1f8869f2eee -r 6955d69a52a4 tests/test-obsolete.t --- a/tests/test-obsolete.t Sat Jul 28 13:19:06 2012 +0200 +++ b/tests/test-obsolete.t Sat Jul 28 13:05:25 2012 +0200 @@ -492,3 +492,17 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) + +Checking _enable=False warning if obsolete marker exist + + $ echo '[extensions]' >> $HGRCPATH + $ echo "obs=!" >> $HGRCPATH + $ hg log -r tip + obsolete feature not enabled but 7 markers found! + changeset: 6:d6a026544050 + tag: tip + parent: 3:5601fb93a350 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add obsolete_e +