Mercurial > hg
comparison tests/test-obsolete.t @ 17296:a1f8869f2eee stable
obsolete: introduce an `_enabled` switch to disable the feature by default
Obsolete markers wide-usage and propagation should be avoided by default until
the obsolete feature is more mature.
This changeset introduce the `_enable` variable and prevent the creation of
obsolete marker if the feature is set to `False` (the default).
More limitation comes in followup changesets.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Sat, 28 Jul 2012 13:19:06 +0200 |
parents | 8da6fe276a23 |
children | 6955d69a52a4 |
comparison
equal
deleted
inserted
replaced
17295:1f08ecc7febb | 17296:a1f8869f2eee |
---|---|
25 > repo.__class__ = debugkeysrepo | 25 > repo.__class__ = debugkeysrepo |
26 > EOF | 26 > EOF |
27 | 27 |
28 $ hg init tmpa | 28 $ hg init tmpa |
29 $ cd tmpa | 29 $ cd tmpa |
30 $ mkcommit kill_me | |
31 | |
32 Checking that the feature is properly disabled | |
33 | |
34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar | |
35 abort: obsolete feature is not enabled on this repo | |
36 [255] | |
37 | |
38 Enabling it | |
39 | |
40 $ cat > ../obs.py << EOF | |
41 > import mercurial.obsolete | |
42 > mercurial.obsolete._enabled = True | |
43 > EOF | |
44 $ echo '[extensions]' >> $HGRCPATH | |
45 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH | |
30 | 46 |
31 Killing a single changeset without replacement | 47 Killing a single changeset without replacement |
32 | 48 |
33 $ mkcommit kill_me | |
34 $ hg debugobsolete 0 | 49 $ hg debugobsolete 0 |
35 abort: changeset references must be full hexadecimal node identifiers | 50 abort: changeset references must be full hexadecimal node identifiers |
36 [255] | 51 [255] |
37 $ hg debugobsolete '00' | 52 $ hg debugobsolete '00' |
38 abort: changeset references must be full hexadecimal node identifiers | 53 abort: changeset references must be full hexadecimal node identifiers |