tests/test-share-safe.t
author Manuel Jacob <me@manueljacob.de>
Thu, 15 Sep 2022 01:48:38 +0200
changeset 49494 c96ed4029fda
parent 49343 4f04bb0d8deb
child 50992 704c3d0878d9
permissions -rw-r--r--
templates: add filter to reverse list The filter supports only lists because for lists, it’s straightforward to implement. Reversing text doesn’t seem very useful and is hard to implement. Reversing the bytes would break multi-bytes encodings. Reversing the code points would break characters consisting of multiple code points. Reversing graphemes is non-trivial without using a library not included in the standard library.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
setup
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
  > [extensions]
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
  > share =
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  > [format]
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
     7
  > use-share-safe = True
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46262
diff changeset
     8
  > [storage]
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46262
diff changeset
     9
  > revlog.persistent-nodemap.slow-path=allow
46850
9dfcadc2cabb test: explicitly use zlib compression in tests/test-share-safe.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46414
diff changeset
    10
  > # enforce zlib to ensure we can upgrade to zstd later
9dfcadc2cabb test: explicitly use zlib compression in tests/test-share-safe.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46414
diff changeset
    11
  > [format]
9dfcadc2cabb test: explicitly use zlib compression in tests/test-share-safe.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46414
diff changeset
    12
  > revlog-compression=zlib
46878
f8f738c24d2f persistent-nodemap: disable it unconditionally for test-share-safe.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46850
diff changeset
    13
  > # we want to be able to enable it later
f8f738c24d2f persistent-nodemap: disable it unconditionally for test-share-safe.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46850
diff changeset
    14
  > use-persistent-nodemap=no
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
  > EOF
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
prepare source repo
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  $ hg init source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  $ cd source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  $ cat .hg/requires
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
    22
  dirstate-v2 (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
    23
  share-safe
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  $ cat .hg/store/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
  revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
  $ hg debugrequirements
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
    33
  dirstate-v2 (dirstate-v2 !)
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  revlogv1
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
    37
  share-safe
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  $ echo a > a
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
  $ hg ci -Aqm "added a"
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
  $ echo b > b
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  $ hg ci -Aqm "added b"
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
    45
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
    46
  $ HGEDITOR=cat hg config --shared
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
    47
  abort: repository is not shared; can't use --shared
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45783
diff changeset
    48
  [10]
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
  $ cd ..
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
Create a shared repo and check the requirements are shared and read correctly
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
  $ hg share source shared1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  updating working directory
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
  $ cd shared1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
  $ cat .hg/requires
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
    57
  dirstate-v2 (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
    58
  share-safe
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  shared
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
  $ hg debugrequirements -R ../source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
    63
  dirstate-v2 (dirstate-v2 !)
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  revlogv1
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
    67
  share-safe
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  $ hg debugrequirements
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
    73
  dirstate-v2 (dirstate-v2 !)
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  revlogv1
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
    77
  share-safe
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
  shared
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    81
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
  $ echo c > c
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
  $ hg ci -Aqm "added c"
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    85
Check that config of the source repository is also loaded
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    86
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    87
  $ hg showconfig ui.curses
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    88
  [1]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    89
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    90
  $ echo "[ui]" >> ../source/.hg/hgrc
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    91
  $ echo "curses=true" >> ../source/.hg/hgrc
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    92
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    93
  $ hg showconfig ui.curses
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    94
  true
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    95
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    96
Test that extensions of source repository are also loaded
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    97
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    98
  $ hg debugextensions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    99
  share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   100
  $ hg extdiff -p echo
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   101
  hg: unknown command 'extdiff'
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   102
  'extdiff' is provided by the following extension:
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   103
  
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   104
      extdiff       command to allow external programs to compare revisions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   105
  
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   106
  (use 'hg help extensions' for information on enabling extensions)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 46239
diff changeset
   107
  [10]
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   108
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   109
  $ echo "[extensions]" >> ../source/.hg/hgrc
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   110
  $ echo "extdiff=" >> ../source/.hg/hgrc
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   111
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   112
  $ hg debugextensions -R ../source
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   113
  extdiff
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   114
  share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   115
  $ hg extdiff -R ../source -p echo
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   116
45782
fd1de908f2b4 dispatch: load shared source repository config in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45781
diff changeset
   117
BROKEN: the command below will not work if config of shared source is not loaded
fd1de908f2b4 dispatch: load shared source repository config in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45781
diff changeset
   118
on dispatch but debugextensions says that extension
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   119
is loaded
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   120
  $ hg debugextensions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   121
  extdiff
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   122
  share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   123
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   124
  $ hg extdiff -p echo
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   125
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   126
However, local .hg/hgrc should override the config set by share source
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   127
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   128
  $ echo "[ui]" >> .hg/hgrc
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   129
  $ echo "curses=false" >> .hg/hgrc
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   130
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   131
  $ hg showconfig ui.curses
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   132
  false
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   133
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   134
  $ HGEDITOR=cat hg config --shared
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   135
  [ui]
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   136
  curses=true
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   137
  [extensions]
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   138
  extdiff=
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   139
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   140
  $ HGEDITOR=cat hg config --local
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   141
  [ui]
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   142
  curses=false
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   143
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   144
Testing that hooks set in source repository also runs in shared repo
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   145
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   146
  $ cd ../source
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   147
  $ cat <<EOF >> .hg/hgrc
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   148
  > [extensions]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   149
  > hooklib=
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   150
  > [hooks]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   151
  > pretxnchangegroup.reject_merge_commits = \
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   152
  >   python:hgext.hooklib.reject_merge_commits.hook
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   153
  > EOF
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   154
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   155
  $ cd ..
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   156
  $ hg clone source cloned
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   157
  updating to branch default
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   158
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   159
  $ cd cloned
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   160
  $ hg up 0
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   161
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   162
  $ echo bar > bar
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   163
  $ hg ci -Aqm "added bar"
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   164
  $ hg merge
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   165
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   166
  (branch merge, don't forget to commit)
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   167
  $ hg ci -m "merge commit"
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   168
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   169
  $ hg push ../source
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   170
  pushing to ../source
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   171
  searching for changes
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   172
  adding changesets
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   173
  adding manifests
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   174
  adding file changes
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   175
  error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   176
  transaction abort!
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   177
  rollback completed
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   178
  abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   179
  [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   180
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   181
  $ hg push ../shared1
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   182
  pushing to ../shared1
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   183
  searching for changes
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   184
  adding changesets
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   185
  adding manifests
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   186
  adding file changes
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   187
  error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   188
  transaction abort!
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   189
  rollback completed
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   190
  abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   191
  [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   192
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   193
Test that if share source config is untrusted, we dont read it
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   194
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   195
  $ cd ../shared1
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   196
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   197
  $ cat << EOF > $TESTTMP/untrusted.py
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   198
  > from mercurial import scmutil, util
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   199
  > def uisetup(ui):
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   200
  >     class untrustedui(ui.__class__):
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   201
  >         def _trusted(self, fp, f):
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   202
  >             if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   203
  >                 return False
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   204
  >             return super(untrustedui, self)._trusted(fp, f)
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   205
  >     ui.__class__ = untrustedui
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   206
  > EOF
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   207
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   208
  $ hg showconfig hooks
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   209
  hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   210
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   211
  $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   212
  [1]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   213
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   214
Update the source repository format and check that shared repo works
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   215
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   216
  $ cd ../source
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   217
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   218
Disable zstd related tests because its not present on pure version
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   219
#if zstd
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   220
  $ echo "[format]" >> .hg/hgrc
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   221
  $ echo "revlog-compression=zstd" >> .hg/hgrc
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   222
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   223
  $ hg debugupgraderepo --run -q
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   224
  upgrade will perform the following actions:
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   225
  
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   226
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   227
     preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   228
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (dirstate-v2 !)
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   229
     added: revlog-compression-zstd
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   230
  
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   231
  processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   232
    - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   233
    - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   234
    - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   235
  
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   236
  $ hg log -r .
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   237
  changeset:   1:5f6d8a4bf34a
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   238
  user:        test
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   239
  date:        Thu Jan 01 00:00:00 1970 +0000
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   240
  summary:     added b
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   241
  
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   242
#endif
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   243
  $ echo "[format]" >> .hg/hgrc
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   244
  $ echo "use-persistent-nodemap=True" >> .hg/hgrc
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   245
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   246
  $ hg debugupgraderepo --run -q -R ../shared1
48779
17eaeb06562c upgrade: prepare code (and output) for the idea of upgrading share
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48681
diff changeset
   247
  abort: cannot use these actions on a share repository: persistent-nodemap
17eaeb06562c upgrade: prepare code (and output) for the idea of upgrading share
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48681
diff changeset
   248
  (upgrade the main repository directly)
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   249
  [255]
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   250
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   251
  $ hg debugupgraderepo --run -q
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   252
  upgrade will perform the following actions:
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   253
  
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   254
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   255
     preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !)
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   256
     preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   257
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd dirstate-v2 !)
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   258
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !)
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   259
     added: persistent-nodemap
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   260
  
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   261
  processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   262
    - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   263
    - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   264
    - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   265
  
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   266
  $ hg log -r .
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   267
  changeset:   1:5f6d8a4bf34a
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   268
  user:        test
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   269
  date:        Thu Jan 01 00:00:00 1970 +0000
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   270
  summary:     added b
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   271
  
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   272
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   273
Shared one should work
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   274
  $ cd ../shared1
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   275
  $ hg log -r .
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   276
  changeset:   2:155349b645be
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   277
  tag:         tip
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   278
  user:        test
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   279
  date:        Thu Jan 01 00:00:00 1970 +0000
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   280
  summary:     added c
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   281
  
45783
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   282
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   283
Testing that nonsharedrc is loaded for source and not shared
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   284
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   285
  $ cd ../source
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   286
  $ touch .hg/hgrc-not-shared
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   287
  $ echo "[ui]" >> .hg/hgrc-not-shared
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   288
  $ echo "traceback=true" >> .hg/hgrc-not-shared
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   289
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   290
  $ hg showconfig ui.traceback
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   291
  true
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   292
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   293
  $ HGEDITOR=cat hg config --non-shared
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   294
  [ui]
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   295
  traceback=true
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   296
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   297
  $ cd ../shared1
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   298
  $ hg showconfig ui.traceback
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   299
  [1]
88a47cbf063c config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45782
diff changeset
   300
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   301
Unsharing works
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   302
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   303
  $ hg unshare
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   304
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   305
Test that source config is added to the shared one after unshare, and the config
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   306
of current repo is still respected over the config which came from source config
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   307
  $ cd ../cloned
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   308
  $ hg push ../shared1
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   309
  pushing to ../shared1
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   310
  searching for changes
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   311
  adding changesets
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   312
  adding manifests
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   313
  adding file changes
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   314
  error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   315
  transaction abort!
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   316
  rollback completed
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   317
  abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   318
  [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   319
  $ hg showconfig ui.curses -R ../shared1
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   320
  false
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   321
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   322
  $ cd ../
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   323
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   324
Test that upgrading using debugupgraderepo works
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   325
=================================================
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   326
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   327
  $ hg init non-share-safe --config format.use-share-safe=false
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   328
  $ cd non-share-safe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   329
  $ hg debugrequirements
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   330
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   331
  dirstate-v2 (dirstate-v2 !)
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   332
  fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   333
  generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   334
  revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   335
  sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   336
  store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   337
  $ echo foo > foo
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   338
  $ hg ci -Aqm 'added foo'
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   339
  $ echo bar > bar
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   340
  $ hg ci -Aqm 'added bar'
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   341
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   342
Create a share before upgrading
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   343
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   344
  $ cd ..
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   345
  $ hg share non-share-safe nss-share
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   346
  updating working directory
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   347
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   348
  $ hg debugrequirements -R nss-share
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   349
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   350
  dirstate-v2 (dirstate-v2 !)
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   351
  fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   352
  generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   353
  revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   354
  shared
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   355
  sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   356
  store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   357
  $ cd non-share-safe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   358
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   359
Upgrade
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   360
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   361
  $ hg debugupgraderepo -q
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   362
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   363
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   364
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   365
     added: share-safe
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   366
  
48448
62e6222cc5b6 upgrade: only process revlogs that needs it by default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   367
  no revlogs to process
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   368
  
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   369
  $ hg debugupgraderepo --run
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   370
  upgrade will perform the following actions:
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   371
  
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   372
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   373
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   374
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   375
     added: share-safe
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   376
  
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   377
  share-safe
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   378
     Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   379
  
48448
62e6222cc5b6 upgrade: only process revlogs that needs it by default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   380
  no revlogs to process
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   381
  
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   382
  beginning upgrade...
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   383
  repository locked and read-only
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   384
  creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   385
  (it is safe to interrupt this process any time before data migration completes)
46380
f2c4224e6648 upgrade: update only requirements if we can
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46378
diff changeset
   386
  upgrading repository requirements
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   387
  removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   388
  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.
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   389
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   390
  $ hg debugrequirements
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   391
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   392
  dirstate-v2 (dirstate-v2 !)
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   393
  fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   394
  generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   395
  revlogv1
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   396
  share-safe
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   397
  sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   398
  store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   399
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   400
  $ cat .hg/requires
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   401
  dirstate-v2 (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   402
  share-safe
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   403
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   404
  $ cat .hg/store/requires
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   405
  dotencode
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   406
  fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   407
  generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   408
  revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   409
  sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   410
  store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   411
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   412
  $ hg log -GT "{node}: {desc}\n"
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   413
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   414
  |
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   415
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   416
  
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   417
46331
8788981c95f8 localrepo: disallow share if there is a version mismatch by default
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46310
diff changeset
   418
Make sure existing shares dont work with default config
46238
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   419
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
   420
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share
46331
8788981c95f8 localrepo: disallow share if there is a version mismatch by default
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46310
diff changeset
   421
  abort: version mismatch: source uses share-safe functionality while the current share does not
46348
4a58561ace0f share-share: have the hint issue more consistently and point to the right doc
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46334
diff changeset
   422
  (see `hg help config.format.use-share-safe` for more information)
46331
8788981c95f8 localrepo: disallow share if there is a version mismatch by default
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46310
diff changeset
   423
  [255]
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   424
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   425
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   426
Create a safe share from upgrade one
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   427
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   428
  $ cd ..
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   429
  $ hg share non-share-safe ss-share
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   430
  updating working directory
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   431
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   432
  $ cd ss-share
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   433
  $ hg log -GT "{node}: {desc}\n"
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   434
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   435
  |
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   436
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   437
  
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   438
  $ cd ../non-share-safe
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   439
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   440
Test that downgrading works too
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   441
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   442
  $ cat >> $HGRCPATH <<EOF
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   443
  > [extensions]
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   444
  > share =
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   445
  > [format]
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   446
  > use-share-safe = False
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   447
  > EOF
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   448
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   449
  $ hg debugupgraderepo -q
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   450
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   451
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   452
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   453
     removed: share-safe
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   454
  
48448
62e6222cc5b6 upgrade: only process revlogs that needs it by default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   455
  no revlogs to process
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   456
  
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   457
  $ hg debugupgraderepo --run
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   458
  upgrade will perform the following actions:
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   459
  
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   460
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   461
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   462
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   463
     removed: share-safe
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   464
  
48448
62e6222cc5b6 upgrade: only process revlogs that needs it by default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   465
  no revlogs to process
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
   466
  
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   467
  beginning upgrade...
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   468
  repository locked and read-only
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   469
  creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   470
  (it is safe to interrupt this process any time before data migration completes)
46380
f2c4224e6648 upgrade: update only requirements if we can
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46378
diff changeset
   471
  upgrading repository requirements
46378
8b02f132adf6 test: unquiet few tests to demonstrate changes in upcoming patches
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46334
diff changeset
   472
  removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   473
  repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   474
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   475
  $ hg debugrequirements
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   476
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   477
  dirstate-v2 (dirstate-v2 !)
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   478
  fncache
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   479
  generaldelta
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   480
  revlogv1
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   481
  sparserevlog
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   482
  store
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   483
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   484
  $ cat .hg/requires
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   485
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   486
  dirstate-v2 (dirstate-v2 !)
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   487
  fncache
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   488
  generaldelta
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   489
  revlogv1
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   490
  sparserevlog
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   491
  store
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   492
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   493
  $ test -f .hg/store/requires
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   494
  [1]
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   495
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   496
  $ hg log -GT "{node}: {desc}\n"
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   497
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   498
  |
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   499
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   500
  
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   501
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   502
Make sure existing shares still works
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   503
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   504
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   505
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   506
  |
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   507
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   508
  
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   509
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   510
  $ hg log -GT "{node}: {desc}\n" -R ../ss-share
46351
085294a8c0e0 share-safe: fix an abort message that references the experimental requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 46348
diff changeset
   511
  abort: share source does not support share-safe requirement
46348
4a58561ace0f share-share: have the hint issue more consistently and point to the right doc
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46334
diff changeset
   512
  (see `hg help config.format.use-share-safe` for more information)
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
   513
  [255]
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   514
46236
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   515
Testing automatic downgrade of shares when config is set
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   516
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   517
  $ touch ../ss-share/.hg/wlock
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   518
  $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
46236
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   519
  abort: failed to downgrade share, got error: Lock held
46348
4a58561ace0f share-share: have the hint issue more consistently and point to the right doc
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46334
diff changeset
   520
  (see `hg help config.format.use-share-safe` for more information)
46236
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   521
  [255]
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   522
  $ rm ../ss-share/.hg/wlock
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   523
49343
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   524
  $ cp -R ../ss-share ../ss-share-bck
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   525
  $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
46236
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   526
  repository downgraded to not use share-safe mode
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   527
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   528
  |
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   529
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   530
  
49343
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   531
  $ rm -rf ../ss-share
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   532
  $ mv ../ss-share-bck ../ss-share
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   533
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   534
  $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort --config share.safe-mismatch.source-not-safe:verbose-upgrade=no
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   535
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   536
  |
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   537
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   538
  
46236
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   539
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   540
  $ hg log -GT "{node}: {desc}\n" -R ../ss-share
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   541
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   542
  |
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   543
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   544
  
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
   545
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   546
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   547
Testing automatic upgrade of shares when config is set
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   548
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   549
  $ hg debugupgraderepo -q --run --config format.use-share-safe=True
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   550
  upgrade will perform the following actions:
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   551
  
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   552
  requirements
47279
40b51c28b242 dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents: 46878
diff changeset
   553
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !)
48674
f7086f6173f8 dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   554
     preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !)
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   555
     added: share-safe
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   556
  
48448
62e6222cc5b6 upgrade: only process revlogs that needs it by default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48321
diff changeset
   557
  no revlogs to process
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   558
  
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   559
  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.
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   560
  $ hg debugrequirements
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   561
  dotencode
48321
f35529784079 dirstate-v2: fix confusion between requirement and format config variable
Raphaël Gomès <rgomes@octobus.net>
parents: 48295
diff changeset
   562
  dirstate-v2 (dirstate-v2 !)
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   563
  fncache
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   564
  generaldelta
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   565
  revlogv1
46334
4b0192f592cf share: move share safe functionality out of experimental
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46333
diff changeset
   566
  share-safe
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   567
  sparserevlog
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   568
  store
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   569
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share
46331
8788981c95f8 localrepo: disallow share if there is a version mismatch by default
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46310
diff changeset
   570
  abort: version mismatch: source uses share-safe functionality while the current share does not
46348
4a58561ace0f share-share: have the hint issue more consistently and point to the right doc
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46334
diff changeset
   571
  (see `hg help config.format.use-share-safe` for more information)
46331
8788981c95f8 localrepo: disallow share if there is a version mismatch by default
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46310
diff changeset
   572
  [255]
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   573
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   574
Check that if lock is taken, upgrade fails but read operation are successful
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   575
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   576
  abort: share-safe mismatch with source.
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   577
  Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set.
46348
4a58561ace0f share-share: have the hint issue more consistently and point to the right doc
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46334
diff changeset
   578
  (see `hg help config.format.use-share-safe` for more information)
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   579
  [255]
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   580
  $ touch ../nss-share/.hg/wlock
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   581
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   582
  failed to upgrade share, got error: Lock held
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   583
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   584
  |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   585
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   586
  
46238
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   587
46333
2eb5fe13461b share: rename share-safe warning config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46332
diff changeset
   588
  $ 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
46238
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   589
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   590
  |
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   591
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   592
  
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
   593
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   594
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
46239
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
   595
  abort: failed to upgrade share, got error: Lock held
46348
4a58561ace0f share-share: have the hint issue more consistently and point to the right doc
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46334
diff changeset
   596
  (see `hg help config.format.use-share-safe` for more information)
46239
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
   597
  [255]
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
   598
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   599
  $ rm ../nss-share/.hg/wlock
49343
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   600
  $ cp -R ../nss-share ../nss-share-bck
46332
cc3452d2dfa4 share: rework config options to be much clearer and easier
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46331
diff changeset
   601
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   602
  repository upgraded to use share-safe mode
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   603
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   604
  |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   605
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   606
  
49343
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   607
  $ rm -rf ../nss-share
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   608
  $ mv ../nss-share-bck ../nss-share
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   609
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort --config share.safe-mismatch.source-safe:verbose-upgrade=no
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   610
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   611
  |
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   612
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
4f04bb0d8deb auto-upgrade: add an option to silence the safe-mismatch message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49194
diff changeset
   613
  
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   614
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   615
Test that unshare works
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   616
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   617
  $ hg unshare -R ../nss-share
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   618
  $ hg log -GT "{node}: {desc}\n" -R ../nss-share
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   619
  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   620
  |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   621
  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
   622
  
49194
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   623
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   624
Test automatique upgrade/downgrade of main-repository
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   625
------------------------------------------------------
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   626
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   627
create an initial repository
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   628
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   629
  $ hg init auto-upgrade \
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   630
  > --config format.use-share-safe=no
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   631
  $ hg debugbuilddag -R auto-upgrade --new-file .+5
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   632
  $ hg -R auto-upgrade update
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   633
  6 files updated, 0 files merged, 0 files removed, 0 files unresolved
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   634
  $ hg debugformat -R auto-upgrade | grep share-safe
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   635
  share-safe:          no
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   636
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   637
upgrade it to share-safe automatically
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   638
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   639
  $ hg status -R auto-upgrade \
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   640
  >     --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   641
  >     --config format.use-share-safe=yes
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   642
  automatically upgrading repository to the `share-safe` feature
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   643
  (see `hg help config.format.use-share-safe` for details)
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   644
  $ hg debugformat -R auto-upgrade | grep share-safe
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   645
  share-safe:         yes
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   646
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   647
downgrade it from share-safe automatically
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   648
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   649
  $ hg status -R auto-upgrade \
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   650
  >     --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   651
  >     --config format.use-share-safe=no
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   652
  automatically downgrading repository from the `share-safe` feature
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   653
  (see `hg help config.format.use-share-safe` for details)
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   654
  $ hg debugformat -R auto-upgrade | grep share-safe
e4b31016e194 auto-upgrade: introduce a way to auto-upgrade to/from tracked-hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48779
diff changeset
   655
  share-safe:          no