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.
--- 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
--- 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
+