comparison tests/test-share-safe.t @ 45781:b1664f6eb650

tests: add test showing broken extension loading in case of share-safe When we are using share-safe and loading source repository config, we are still not loading the extensions which are enabled in the source repository. This patch demonstrates the bug. Meanwhile it also shows how unreliable `hg debugextensions` is. Differential Revision: https://phab.mercurial-scm.org/D9046
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 18 Sep 2020 17:28:22 +0530
parents 68906595016c
children fd1de908f2b4
comparison
equal deleted inserted replaced
45780:ae2873e92250 45781:b1664f6eb650
79 $ echo "curses=true" >> ../source/.hg/hgrc 79 $ echo "curses=true" >> ../source/.hg/hgrc
80 80
81 $ hg showconfig ui.curses 81 $ hg showconfig ui.curses
82 true 82 true
83 83
84 Test that extensions of source repository are also loaded
85
86 $ hg debugextensions
87 share
88 $ hg extdiff -p echo
89 hg: unknown command 'extdiff'
90 'extdiff' is provided by the following extension:
91
92 extdiff command to allow external programs to compare revisions
93
94 (use 'hg help extensions' for information on enabling extensions)
95 [255]
96
97 $ echo "[extensions]" >> ../source/.hg/hgrc
98 $ echo "extdiff=" >> ../source/.hg/hgrc
99
100 $ hg debugextensions -R ../source
101 extdiff
102 share
103 $ hg extdiff -R ../source -p echo
104
105 BROKEN: the command below does not work but debugextensions says that extension
106 is loaded
107 $ hg debugextensions
108 extdiff
109 share
110
111 BROKEN: extdiff command should work here
112 $ hg extdiff -p echo
113 hg: unknown command 'extdiff'
114 'extdiff' is provided by the following extension:
115
116 extdiff command to allow external programs to compare revisions
117
118 (use 'hg help extensions' for information on enabling extensions)
119 [255]
120
84 However, local .hg/hgrc should override the config set by share source 121 However, local .hg/hgrc should override the config set by share source
85 122
86 $ echo "[ui]" >> .hg/hgrc 123 $ echo "[ui]" >> .hg/hgrc
87 $ echo "curses=false" >> .hg/hgrc 124 $ echo "curses=false" >> .hg/hgrc
88 125
90 false 127 false
91 128
92 $ HGEDITOR=cat hg config --shared 129 $ HGEDITOR=cat hg config --shared
93 [ui] 130 [ui]
94 curses=true 131 curses=true
132 [extensions]
133 extdiff=
95 134
96 $ HGEDITOR=cat hg config --local 135 $ HGEDITOR=cat hg config --local
97 [ui] 136 [ui]
98 curses=false 137 curses=false
99 138