##// END OF EJS Templates
upgrade: prepare code (and output) for the idea of upgrading share...
upgrade: prepare code (and output) for the idea of upgrading share This would work for a subset of action only. Our first target is dirstate-v2. Differential Revision: https://phab.mercurial-scm.org/D12196

File last commit:

r49628:17eaeb06 default
r49628:17eaeb06 default
Show More
test-share-safe.t
605 lines | 16.7 KiB | text/troff | Tads3Lexer
/ tests / test-share-safe.t
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 setup
$ cat >> $HGRCPATH <<EOF
> [extensions]
> share =
> [format]
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 > use-share-safe = True
persistent-nodemap: add a "warn" option to the slow-path config...
r47028 > [storage]
> revlog.persistent-nodemap.slow-path=allow
test: explicitly use zlib compression in tests/test-share-safe.t...
r47609 > # enforce zlib to ensure we can upgrade to zstd later
> [format]
> revlog-compression=zlib
persistent-nodemap: disable it unconditionally for test-share-safe.t...
r47640 > # we want to be able to enable it later
> use-persistent-nodemap=no
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 > EOF
prepare source repo
$ hg init source
$ cd source
$ cat .hg/requires
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 $ cat .hg/store/requires
dotencode
fncache
generaldelta
revlogv1
sparserevlog
store
$ hg debugrequirements
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 fncache
generaldelta
revlogv1
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 sparserevlog
store
$ echo a > a
$ hg ci -Aqm "added a"
$ echo b > b
$ hg ci -Aqm "added b"
Pulkit Goyal
config: add `--shared` flag to edit config file of shared source...
r46058
$ HGEDITOR=cat hg config --shared
abort: repository is not shared; can't use --shared
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 $ cd ..
Create a shared repo and check the requirements are shared and read correctly
$ hg share source shared1
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd shared1
$ cat .hg/requires
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 shared
$ hg debugrequirements -R ../source
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 fncache
generaldelta
revlogv1
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 sparserevlog
store
$ hg debugrequirements
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 fncache
generaldelta
revlogv1
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 shared
sparserevlog
store
$ echo c > c
$ hg ci -Aqm "added c"
Pulkit Goyal
localrepo: load the share source .hg/hgrc also in share-safe mode (API)...
r46057 Check that config of the source repository is also loaded
$ hg showconfig ui.curses
[1]
$ echo "[ui]" >> ../source/.hg/hgrc
$ echo "curses=true" >> ../source/.hg/hgrc
$ hg showconfig ui.curses
true
Pulkit Goyal
tests: add test showing broken extension loading in case of share-safe...
r46366 Test that extensions of source repository are also loaded
$ hg debugextensions
share
$ hg extdiff -p echo
hg: unknown command 'extdiff'
'extdiff' is provided by the following extension:
extdiff command to allow external programs to compare revisions
(use 'hg help extensions' for information on enabling extensions)
Martin von Zweigbergk
error: use detailed exit code 10 for command errors...
r46888 [10]
Pulkit Goyal
tests: add test showing broken extension loading in case of share-safe...
r46366
$ echo "[extensions]" >> ../source/.hg/hgrc
$ echo "extdiff=" >> ../source/.hg/hgrc
$ hg debugextensions -R ../source
extdiff
share
$ hg extdiff -R ../source -p echo
Pulkit Goyal
dispatch: load shared source repository config in share-safe mode...
r46367 BROKEN: the command below will not work if config of shared source is not loaded
on dispatch but debugextensions says that extension
Pulkit Goyal
tests: add test showing broken extension loading in case of share-safe...
r46366 is loaded
$ hg debugextensions
extdiff
share
$ hg extdiff -p echo
Pulkit Goyal
localrepo: load the share source .hg/hgrc also in share-safe mode (API)...
r46057 However, local .hg/hgrc should override the config set by share source
$ echo "[ui]" >> .hg/hgrc
$ echo "curses=false" >> .hg/hgrc
$ hg showconfig ui.curses
false
Pulkit Goyal
config: add `--shared` flag to edit config file of shared source...
r46058 $ HGEDITOR=cat hg config --shared
[ui]
curses=true
Pulkit Goyal
tests: add test showing broken extension loading in case of share-safe...
r46366 [extensions]
extdiff=
Pulkit Goyal
config: add `--shared` flag to edit config file of shared source...
r46058
$ HGEDITOR=cat hg config --local
[ui]
curses=false
Pulkit Goyal
localrepo: load the share source .hg/hgrc also in share-safe mode (API)...
r46057 Testing that hooks set in source repository also runs in shared repo
$ cd ../source
$ cat <<EOF >> .hg/hgrc
> [extensions]
> hooklib=
> [hooks]
> pretxnchangegroup.reject_merge_commits = \
> python:hgext.hooklib.reject_merge_commits.hook
> EOF
$ cd ..
$ hg clone source cloned
updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd cloned
$ hg up 0
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ echo bar > bar
$ hg ci -Aqm "added bar"
$ hg merge
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -m "merge commit"
$ hg push ../source
pushing to ../source
searching for changes
adding changesets
adding manifests
adding file changes
error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
transaction abort!
rollback completed
abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
[255]
$ hg push ../shared1
pushing to ../shared1
searching for changes
adding changesets
adding manifests
adding file changes
error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
transaction abort!
rollback completed
abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
[255]
Test that if share source config is untrusted, we dont read it
$ cd ../shared1
$ cat << EOF > $TESTTMP/untrusted.py
> from mercurial import scmutil, util
> def uisetup(ui):
> class untrustedui(ui.__class__):
> def _trusted(self, fp, f):
> if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
> return False
> return super(untrustedui, self)._trusted(fp, f)
> ui.__class__ = untrustedui
> EOF
$ hg showconfig hooks
hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
$ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
[1]
Pulkit Goyal
upgrade: support running upgrade if repository has share-safe requirement...
r46059 Update the source repository format and check that shared repo works
$ cd ../source
Pulkit Goyal
tests: update test-share-safe to work with non-zstd versions...
r46114
Disable zstd related tests because its not present on pure version
#if zstd
Pulkit Goyal
upgrade: support running upgrade if repository has share-safe requirement...
r46059 $ echo "[format]" >> .hg/hgrc
$ echo "revlog-compression=zstd" >> .hg/hgrc
$ hg debugupgraderepo --run -q
upgrade will perform the following actions:
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (dirstate-v2 !)
Pulkit Goyal
upgrade: support running upgrade if repository has share-safe requirement...
r46059 added: revlog-compression-zstd
upgrade: display the list of processed revlog before proceeding...
r46649 processed revlogs:
- all-filelogs
- changelog
- manifest
Pulkit Goyal
upgrade: support running upgrade if repository has share-safe requirement...
r46059 $ hg log -r .
changeset: 1:5f6d8a4bf34a
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: added b
Pulkit Goyal
tests: update test-share-safe to work with non-zstd versions...
r46114 #endif
$ echo "[format]" >> .hg/hgrc
$ echo "use-persistent-nodemap=True" >> .hg/hgrc
$ hg debugupgraderepo --run -q -R ../shared1
upgrade: prepare code (and output) for the idea of upgrading share...
r49628 abort: cannot use these actions on a share repository: persistent-nodemap
(upgrade the main repository directly)
Pulkit Goyal
tests: update test-share-safe to work with non-zstd versions...
r46114 [255]
$ hg debugupgraderepo --run -q
upgrade will perform the following actions:
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !)
preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd dirstate-v2 !)
preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !)
Pulkit Goyal
tests: update test-share-safe to work with non-zstd versions...
r46114 added: persistent-nodemap
upgrade: display the list of processed revlog before proceeding...
r46649 processed revlogs:
- all-filelogs
- changelog
- manifest
Pulkit Goyal
tests: update test-share-safe to work with non-zstd versions...
r46114 $ hg log -r .
changeset: 1:5f6d8a4bf34a
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: added b
Pulkit Goyal
upgrade: support running upgrade if repository has share-safe requirement...
r46059 Shared one should work
$ cd ../shared1
$ hg log -r .
changeset: 2:155349b645be
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: added c
Pulkit Goyal
config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode...
r46368
Testing that nonsharedrc is loaded for source and not shared
$ cd ../source
$ touch .hg/hgrc-not-shared
$ echo "[ui]" >> .hg/hgrc-not-shared
$ echo "traceback=true" >> .hg/hgrc-not-shared
$ hg showconfig ui.traceback
true
$ HGEDITOR=cat hg config --non-shared
[ui]
traceback=true
$ cd ../shared1
$ hg showconfig ui.traceback
[1]
Pulkit Goyal
localrepo: load the share source .hg/hgrc also in share-safe mode (API)...
r46057 Unsharing works
Pulkit Goyal
share: introduce config option to store requires in .hg/store...
r46055 $ hg unshare
Pulkit Goyal
localrepo: load the share source .hg/hgrc also in share-safe mode (API)...
r46057
Test that source config is added to the shared one after unshare, and the config
of current repo is still respected over the config which came from source config
$ cd ../cloned
$ hg push ../shared1
pushing to ../shared1
searching for changes
adding changesets
adding manifests
adding file changes
error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
transaction abort!
rollback completed
abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
[255]
$ hg showconfig ui.curses -R ../shared1
false
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617
$ cd ../
Test that upgrading using debugupgraderepo works
=================================================
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 $ hg init non-share-safe --config format.use-share-safe=false
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 $ cd non-share-safe
$ hg debugrequirements
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 fncache
generaldelta
revlogv1
sparserevlog
store
$ echo foo > foo
$ hg ci -Aqm 'added foo'
$ echo bar > bar
$ hg ci -Aqm 'added bar'
Create a share before upgrading
$ cd ..
$ hg share non-share-safe nss-share
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg debugrequirements -R nss-share
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 fncache
generaldelta
revlogv1
shared
sparserevlog
store
$ cd non-share-safe
Upgrade
$ hg debugupgraderepo -q
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 added: share-safe
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617
upgrade: only process revlogs that needs it by default...
r49277 no revlogs to process
upgrade: display the list of processed revlog before proceeding...
r46649
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 $ hg debugupgraderepo --run
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 upgrade will perform the following actions:
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 added: share-safe
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 share-safe
Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
upgrade: only process revlogs that needs it by default...
r49277 no revlogs to process
upgrade: display the list of processed revlog before proceeding...
r46649
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 beginning upgrade...
repository locked and read-only
creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
(it is safe to interrupt this process any time before data migration completes)
Pulkit Goyal
upgrade: update only requirements if we can...
r47097 upgrading repository requirements
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
$ hg debugrequirements
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 fncache
generaldelta
revlogv1
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 sparserevlog
store
$ cat .hg/requires
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617
$ cat .hg/store/requires
dotencode
fncache
generaldelta
revlogv1
sparserevlog
store
$ hg log -GT "{node}: {desc}\n"
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
Pulkit Goyal
localrepo: disallow share if there is a version mismatch by default...
r47049 Make sure existing shares dont work with default config
Pulkit Goyal
sharesafe: make warning about outdated share configurable...
r46855
Pulkit Goyal
upgrade: add support for experimental safe share mode...
r46617 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
Pulkit Goyal
localrepo: disallow share if there is a version mismatch by default...
r47049 abort: version mismatch: source uses share-safe functionality while the current share does not
share-share: have the hint issue more consistently and point to the right doc...
r47077 (see `hg help config.format.use-share-safe` for more information)
Pulkit Goyal
localrepo: disallow share if there is a version mismatch by default...
r47049 [255]
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618
Create a safe share from upgrade one
$ cd ..
$ hg share non-share-safe ss-share
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ss-share
$ hg log -GT "{node}: {desc}\n"
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
$ cd ../non-share-safe
Test that downgrading works too
$ cat >> $HGRCPATH <<EOF
> [extensions]
> share =
> [format]
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 > use-share-safe = False
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618 > EOF
$ hg debugupgraderepo -q
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 removed: share-safe
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618
upgrade: only process revlogs that needs it by default...
r49277 no revlogs to process
upgrade: display the list of processed revlog before proceeding...
r46649
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 $ hg debugupgraderepo --run
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618 upgrade will perform the following actions:
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 removed: share-safe
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618
upgrade: only process revlogs that needs it by default...
r49277 no revlogs to process
upgrade: display the list of processed revlog before proceeding...
r46649
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 beginning upgrade...
repository locked and read-only
creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
(it is safe to interrupt this process any time before data migration completes)
Pulkit Goyal
upgrade: update only requirements if we can...
r47097 upgrading repository requirements
Pulkit Goyal
test: unquiet few tests to demonstrate changes in upcoming patches...
r47095 removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
$ hg debugrequirements
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618 fncache
generaldelta
revlogv1
sparserevlog
store
$ cat .hg/requires
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618 fncache
generaldelta
revlogv1
sparserevlog
store
$ test -f .hg/store/requires
[1]
$ hg log -GT "{node}: {desc}\n"
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
Make sure existing shares still works
$ hg log -GT "{node}: {desc}\n" -R ../nss-share
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
$ hg log -GT "{node}: {desc}\n" -R ../ss-share
Matt Harbison
share-safe: fix an abort message that references the experimental requirement...
r47088 abort: share source does not support share-safe requirement
share-share: have the hint issue more consistently and point to the right doc...
r47077 (see `hg help config.format.use-share-safe` for more information)
Pulkit Goyal
upgrade: add support to downgrade share safe mode...
r46618 [255]
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852
Pulkit Goyal
sharesafe: add functionality to automatically downgrade shares...
r46853 Testing automatic downgrade of shares when config is set
$ touch ../ss-share/.hg/wlock
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
Pulkit Goyal
sharesafe: add functionality to automatically downgrade shares...
r46853 abort: failed to downgrade share, got error: Lock held
share-share: have the hint issue more consistently and point to the right doc...
r47077 (see `hg help config.format.use-share-safe` for more information)
Pulkit Goyal
sharesafe: add functionality to automatically downgrade shares...
r46853 [255]
$ rm ../ss-share/.hg/wlock
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
Pulkit Goyal
sharesafe: add functionality to automatically downgrade shares...
r46853 repository downgraded to not use share-safe mode
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
$ hg log -GT "{node}: {desc}\n" -R ../ss-share
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852
Testing automatic upgrade of shares when config is set
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 $ hg debugupgraderepo -q --run --config format.use-share-safe=True
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 upgrade will perform the following actions:
requirements
Simon Sapin
dirstate-v2: Update the expected output of some tests for new requirement...
r48054 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
dirstate-v2: rename the configuration to enable the format...
r49523 preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 added: share-safe
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852
upgrade: only process revlogs that needs it by default...
r49277 no revlogs to process
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852
repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
$ hg debugrequirements
dotencode
Raphaël Gomès
dirstate-v2: fix confusion between requirement and format config variable...
r49142 dirstate-v2 (dirstate-v2 !)
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 fncache
generaldelta
revlogv1
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 sparserevlog
store
$ hg log -GT "{node}: {desc}\n" -R ../nss-share
Pulkit Goyal
localrepo: disallow share if there is a version mismatch by default...
r47049 abort: version mismatch: source uses share-safe functionality while the current share does not
share-share: have the hint issue more consistently and point to the right doc...
r47077 (see `hg help config.format.use-share-safe` for more information)
Pulkit Goyal
localrepo: disallow share if there is a version mismatch by default...
r47049 [255]
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852
Check that if lock is taken, upgrade fails but read operation are successful
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra
abort: share-safe mismatch with source.
Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set.
share-share: have the hint issue more consistently and point to the right doc...
r47077 (see `hg help config.format.use-share-safe` for more information)
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 [255]
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 $ touch ../nss-share/.hg/wlock
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 failed to upgrade share, got error: Lock held
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
Pulkit Goyal
sharesafe: make warning about outdated share configurable...
r46855
Pulkit Goyal
share: rename share-safe warning config...
r47051 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False
Pulkit Goyal
sharesafe: make warning about outdated share configurable...
r46855 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
Pulkit Goyal
sharesafe: introduce config to disallow outdated shares if upgrade fails...
r46856 abort: failed to upgrade share, got error: Lock held
share-share: have the hint issue more consistently and point to the right doc...
r47077 (see `hg help config.format.use-share-safe` for more information)
Pulkit Goyal
sharesafe: introduce config to disallow outdated shares if upgrade fails...
r46856 [255]
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 $ rm ../nss-share/.hg/wlock
Pulkit Goyal
share: rework config options to be much clearer and easier...
r47050 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
Pulkit Goyal
sharesafe: introduce functionality to automatically upgrade shares...
r46852 repository upgraded to use share-safe mode
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
Test that unshare works
$ hg unshare -R ../nss-share
$ hg log -GT "{node}: {desc}\n" -R ../nss-share
@ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
|
o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo