Mercurial > hg > mercurial-source
comparison tests/test-largefiles.t @ 19779:fb6e87d93948
largefiles: setup "largefiles" feature in each repositories individually
Before this patch, if largefiles extension is enabled once in any of
target repositories, commands handling multiple repositories at a time
like below misunderstand that "largefiles" feature is supported also
in all other local repositories:
- clone/pull from or push to localhost
- recursive execution in subrepo tree
This patch registers "featuresetup()" into "featuresetupfuncs" of
"localrepository" to support "largefiles" features only in
repositories enabling largefiles extension, instead of adding
"largefiles" feature to class variable "_basesupported" of
"localrepository".
This patch also adds checking below to the largefiles specific class
derived from "localrepository":
- push to localhost: whether features supported in the local(= dst)
repository satisfies ones required in the remote(= src)
This can prevent useless looking up in the remote repository, when
supported and required features are mismatched: "push()" of
"localrepository" also checks it, but it is executed after looking up
in the remote.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 21 Sep 2013 21:33:29 +0900 |
parents | 32e502b26983 |
children | 41abe2e3e3b7 |
comparison
equal
deleted
inserted
replaced
19778:55ef79031009 | 19779:fb6e87d93948 |
---|---|
2189 largefiles to upload: | 2189 largefiles to upload: |
2190 b | 2190 b |
2191 | 2191 |
2192 | 2192 |
2193 $ cd .. | 2193 $ cd .. |
2194 | |
2195 Check whether "largefiles" feature is supported only in repositories | |
2196 enabling largefiles extension. | |
2197 | |
2198 $ mkdir individualenabling | |
2199 $ cd individualenabling | |
2200 | |
2201 $ hg init enabledlocally | |
2202 $ echo large > enabledlocally/large | |
2203 $ hg -R enabledlocally add --large enabledlocally/large | |
2204 $ hg -R enabledlocally commit -m '#0' | |
2205 Invoking status precommit hook | |
2206 A large | |
2207 | |
2208 $ hg init notenabledlocally | |
2209 $ echo large > notenabledlocally/large | |
2210 $ hg -R notenabledlocally add --large notenabledlocally/large | |
2211 $ hg -R notenabledlocally commit -m '#0' | |
2212 Invoking status precommit hook | |
2213 A large | |
2214 | |
2215 $ cat >> $HGRCPATH <<EOF | |
2216 > [extensions] | |
2217 > # disable globally | |
2218 > largefiles=! | |
2219 > EOF | |
2220 $ cat >> enabledlocally/.hg/hgrc <<EOF | |
2221 > [extensions] | |
2222 > # enable locally | |
2223 > largefiles= | |
2224 > EOF | |
2225 $ hg -R enabledlocally root | |
2226 $TESTTMP/individualenabling/enabledlocally | |
2227 $ hg -R notenabledlocally root | |
2228 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)! | |
2229 [255] | |
2230 | |
2231 $ hg init push-dst | |
2232 $ hg -R enabledlocally push push-dst | |
2233 pushing to push-dst | |
2234 abort: required features are not supported in the destination: largefiles | |
2235 [255] | |
2236 | |
2237 $ hg init pull-src | |
2238 $ hg -R pull-src pull enabledlocally | |
2239 pulling from enabledlocally | |
2240 abort: required features are not supported in the destination: largefiles | |
2241 [255] | |
2242 | |
2243 $ hg clone enabledlocally clone-dst | |
2244 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)! | |
2245 [255] | |
2246 $ test -d clone-dst | |
2247 [1] | |
2248 $ hg clone --pull enabledlocally clone-pull-dst | |
2249 abort: required features are not supported in the destination: largefiles | |
2250 [255] | |
2251 $ test -d clone-pull-dst | |
2252 [1] | |
2253 | |
2254 $ cd .. |