tests/test-share-safe.t
author Pulkit Goyal <7895pulkit@gmail.com>
Fri, 18 Sep 2020 17:28:22 +0530
changeset 45781 b1664f6eb650
parent 45543 68906595016c
child 45782 fd1de908f2b4
permissions -rw-r--r--
tests: add test showing broken extension loading in case of share-safe When we are using share-safe and loading source repository config, we are still not loading the extensions which are enabled in the source repository. This patch demonstrates the bug. Meanwhile it also shows how unreliable `hg debugextensions` is. Differential Revision: https://phab.mercurial-scm.org/D9046
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]
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > exp-share-safe = True
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > EOF
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
prepare source repo
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  $ hg init source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
  $ cd source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
  $ cat .hg/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
  exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ cat .hg/store/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  $ hg debugrequirements
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  exp-sharesafe
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
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
  $ echo a > a
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
  $ hg ci -Aqm "added a"
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  $ echo b > b
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  $ 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
    36
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
    37
  $ 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
    38
  abort: repository is not shared; can't use --shared
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
    39
  [255]
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
  $ cd ..
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
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
    43
  $ hg share source shared1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  updating working directory
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  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
    46
  $ cd shared1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  $ cat .hg/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
  shared
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
  $ hg debugrequirements -R ../source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
  dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
  revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
  $ hg debugrequirements
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
  dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
  exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
  fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
  generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  shared
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
  sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  $ echo c > c
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  $ hg ci -Aqm "added c"
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    73
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
    74
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    75
  $ 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
    76
  [1]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    77
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    78
  $ 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
    79
  $ 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
    80
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    81
  $ 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
    82
  true
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
    83
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    84
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
    85
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    86
  $ hg debugextensions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    87
  share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    88
  $ 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
    89
  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
    90
  '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
    91
  
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    92
      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
    93
  
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    94
  (use 'hg help extensions' for information on enabling extensions)
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    95
  [255]
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    96
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
    97
  $ 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
    98
  $ 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
    99
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   100
  $ 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
   101
  extdiff
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   102
  share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   103
  $ 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
   104
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   105
BROKEN: the command below does not work but debugextensions says that extension
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   106
is loaded
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   107
  $ hg debugextensions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   108
  extdiff
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   109
  share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   110
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   111
BROKEN: extdiff command should work here
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   112
  $ 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
   113
  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
   114
  '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
   115
  
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   116
      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
   117
  
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   118
  (use 'hg help extensions' for information on enabling extensions)
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   119
  [255]
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   120
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   121
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
   122
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   123
  $ 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
   124
  $ 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
   125
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   126
  $ 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
   127
  false
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   128
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   129
  $ 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
   130
  [ui]
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   131
  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
   132
  [extensions]
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
   133
  extdiff=
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   134
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   135
  $ 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
   136
  [ui]
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   137
  curses=false
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
   138
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   139
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
   140
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   141
  $ 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
   142
  $ 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
   143
  > [extensions]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   144
  > hooklib=
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   145
  > [hooks]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   146
  > 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
   147
  >   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
   148
  > EOF
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   149
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   150
  $ cd ..
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   151
  $ 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
   152
  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
   153
  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
   154
  $ 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
   155
  $ 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
   156
  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
   157
  $ 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
   158
  $ 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
   159
  $ 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
   160
  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
   161
  (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
   162
  $ 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
   163
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 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
   165
  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
   166
  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
   167
  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
   168
  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
   169
  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
   170
  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
   171
  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
   172
  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
   173
  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
   174
  [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   175
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   176
  $ 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
   177
  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
   178
  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
   179
  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
   180
  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
   181
  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
   182
  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
   183
  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
   184
  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
   185
  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
   186
  [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   187
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   188
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
   189
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   190
  $ 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
   191
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   192
  $ 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
   193
  > 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
   194
  > 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
   195
  >     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
   196
  >         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
   197
  >             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
   198
  >                 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
   199
  >             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
   200
  >     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
   201
  > EOF
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   202
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   203
  $ 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
   204
  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
   205
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   206
  $ 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
   207
  [1]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   208
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   209
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
   210
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   211
  $ cd ../source
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   212
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   213
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
   214
#if zstd
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   215
  $ echo "[format]" >> .hg/hgrc
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   216
  $ 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
   217
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   218
  $ hg debugupgraderepo --run -q
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   219
  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
   220
  
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   221
  requirements
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   222
     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   223
     added: revlog-compression-zstd
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   224
  
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   225
  $ hg log -r .
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   226
  changeset:   1:5f6d8a4bf34a
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   227
  user:        test
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   228
  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
   229
  summary:     added b
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   230
  
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   231
#endif
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   232
  $ 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
   233
  $ 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
   234
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   235
  $ hg debugupgraderepo --run -q -R ../shared1
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   236
  abort: cannot upgrade repository; unsupported source requirement: shared
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   237
  [255]
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   238
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   239
  $ 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
   240
  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
   241
  
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   242
  requirements
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   243
     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   244
     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   245
     added: persistent-nodemap
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   246
  
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   247
  $ hg log -r .
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   248
  changeset:   1:5f6d8a4bf34a
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   249
  user:        test
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   250
  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
   251
  summary:     added b
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   252
  
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
   253
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   254
Shared one should work
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   255
  $ cd ../shared1
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   256
  $ hg log -r .
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   257
  changeset:   2:155349b645be
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   258
  tag:         tip
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   259
  user:        test
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   260
  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
   261
  summary:     added c
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
   262
  
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   263
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
   264
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  $ 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
   266
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   267
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
   268
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
   269
  $ 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
   270
  $ 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
   271
  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
   272
  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
   273
  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
   274
  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
   275
  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
   276
  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
   277
  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
   278
  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
   279
  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
   280
  [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
   281
  $ 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
   282
  false