annotate tests/test-share-safe.t @ 46325:e5e6282fa66a

hghave: split apart testing for the curses module and `tic` executable ef771d329961 skipped the check for the `tic` executable, because the curses module alone on Windows is enough to pass the `test-*-curses.t` tests. However, `test-status-color.t` uses this same check and explicitly invoked the executable, which fails on Windows. From the cursory searching I did, curses on unix requires `tic`, which I assume is why they were tied together in the first place. So this continues to require both to get past the curses guards on non Windows platforms. Differential Revision: https://phab.mercurial-scm.org/D9814
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 17 Jan 2021 22:25:15 -0500
parents fc2d5c0aed7f
children 8788981c95f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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
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
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
10 > EOF
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 prepare source repo
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
13
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
14 $ hg init source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
15 $ cd source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
16 $ cat .hg/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
17 exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
18 $ cat .hg/store/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
19 dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
20 fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
21 generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
22 revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
23 sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
24 store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
25 $ hg debugrequirements
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
26 dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
27 exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
28 fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
29 generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
30 revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
31 sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
32 store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
33
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
34 $ echo a > a
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
35 $ hg ci -Aqm "added a"
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
36 $ echo b > b
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
37 $ 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
38
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
39 $ 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
40 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
41 [10]
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
42 $ cd ..
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
43
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
44 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
45 $ hg share source shared1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
46 updating working directory
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
47 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
48 $ cd shared1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
49 $ cat .hg/requires
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
50 exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
51 shared
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
52
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
53 $ hg debugrequirements -R ../source
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
54 dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
55 exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
56 fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
57 generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
58 revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
59 sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
60 store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
61
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
62 $ hg debugrequirements
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
63 dotencode
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
64 exp-sharesafe
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
65 fncache
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
66 generaldelta
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
67 revlogv1
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
68 shared
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
69 sparserevlog
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
70 store
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
71
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
72 $ echo c > c
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
73 $ hg ci -Aqm "added c"
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
74
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
75 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
76
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
77 $ 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
78 [1]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
79
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
80 $ 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
81 $ 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
82
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
83 $ 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
84 true
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
85
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
86 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
87
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
88 $ hg debugextensions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
89 share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
90 $ 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
91 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
92 '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
93
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
94 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
95
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
96 (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
97 [10]
45781
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
98
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
99 $ 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
100 $ 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
101
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
102 $ 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
103 extdiff
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
104 share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
105 $ 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
106
45782
fd1de908f2b4 dispatch: load shared source repository config in share-safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45781
diff changeset
107 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
108 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
109 is loaded
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
110 $ hg debugextensions
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
111 extdiff
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
112 share
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
113
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
114 $ 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
115
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
116 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
117
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
118 $ 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
119 $ 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
120
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
121 $ 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
122 false
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
123
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
124 $ 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
125 [ui]
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
126 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
127 [extensions]
b1664f6eb650 tests: add test showing broken extension loading in case of share-safe
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45543
diff changeset
128 extdiff=
45486
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
129
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
130 $ 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
131 [ui]
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
132 curses=false
ac7a3da0dbb6 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45485
diff changeset
133
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
134 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
135
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
136 $ 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
137 $ 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
138 > [extensions]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
139 > hooklib=
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
140 > [hooks]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
141 > 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
142 > 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
143 > EOF
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
144
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
145 $ cd ..
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
146 $ 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
147 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
148 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
149 $ 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
150 $ 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
151 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
152 $ 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
153 $ 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
154 $ 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
155 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
156 (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
157 $ 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
158
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 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
160 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
161 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
162 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
163 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
164 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
165 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
166 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
167 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
168 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
169 [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
170
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
171 $ 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
172 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
173 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
174 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
175 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
176 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
177 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
178 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
179 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
180 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
181 [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
182
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
183 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
184
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
185 $ 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
186
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
187 $ 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
188 > 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
189 > 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
190 > 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
191 > 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
192 > 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
193 > 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
194 > 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
195 > 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
196 > EOF
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
197
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
198 $ 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
199 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
200
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
201 $ 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
202 [1]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
203
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
204 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
205
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
206 $ cd ../source
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
207
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
208 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
209 #if zstd
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
210 $ echo "[format]" >> .hg/hgrc
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
211 $ 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
212
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
213 $ hg debugupgraderepo --run -q
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
214 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
215
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
216 requirements
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
217 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
218 added: revlog-compression-zstd
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
219
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
220 processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
221 - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
222 - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
223 - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
224
45487
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
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
247 processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
248 - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
249 - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
250 - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
251
45543
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
252 $ hg log -r .
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
253 changeset: 1:5f6d8a4bf34a
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
254 user: test
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
255 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
256 summary: added b
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
257
68906595016c tests: update test-share-safe to work with non-zstd versions
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45487
diff changeset
258
45487
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
259 Shared one should work
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
260 $ cd ../shared1
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
261 $ hg log -r .
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
262 changeset: 2:155349b645be
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
263 tag: tip
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
264 user: test
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
265 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
266 summary: added c
78f0bb37f52d upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45486
diff changeset
267
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
268
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
269 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
270
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
271 $ 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
272 $ 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
273 $ 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
274 $ 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
275
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
276 $ 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
277 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
278
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
279 $ 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
280 [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
281 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
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 $ 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
284 $ 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
285 [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
286
45485
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
287 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
288
45483
d252f51ab032 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
289 $ 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
290
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
291 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
292 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
293 $ 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
294 $ 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
295 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
296 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
297 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
298 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
299 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
300 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
301 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
302 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
303 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
304 [255]
b71858b42963 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45483
diff changeset
305 $ 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
306 false
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
307
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
308 $ cd ../
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
309
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
310 Test that upgrading using debugupgraderepo works
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
311 =================================================
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
312
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
313 $ hg init non-share-safe --config format.exp-share-safe=false
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
314 $ cd non-share-safe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
315 $ hg debugrequirements
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
316 dotencode
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
317 fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
318 generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
319 revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
320 sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
321 store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
322 $ echo foo > foo
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
323 $ hg ci -Aqm 'added foo'
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
324 $ echo bar > bar
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
325 $ hg ci -Aqm 'added bar'
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
326
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
327 Create a share before upgrading
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
328
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
329 $ cd ..
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
330 $ 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
331 updating working directory
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
332 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
333 $ hg debugrequirements -R nss-share
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
334 dotencode
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
335 fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
336 generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
337 revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
338 shared
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
339 sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
340 store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
341 $ cd non-share-safe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
342
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
343 Upgrade
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
344
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
345 $ hg debugupgraderepo -q
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
346 requirements
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
347 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
348 added: exp-sharesafe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
349
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
350 processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
351 - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
352 - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
353 - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
354
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
355 $ hg debugupgraderepo --run -q
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
356 upgrade will perform the following actions:
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
357
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
358 requirements
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
359 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
360 added: exp-sharesafe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
361
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
362 processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
363 - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
364 - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
365 - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
366
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
367 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
368
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
369 $ hg debugrequirements
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
370 dotencode
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
371 exp-sharesafe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
372 fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
373 generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
374 revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
375 sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
376 store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
377
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
378 $ cat .hg/requires
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
379 exp-sharesafe
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
380
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
381 $ cat .hg/store/requires
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
382 dotencode
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
383 fncache
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
384 generaldelta
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
385 revlogv1
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
386 sparserevlog
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
387 store
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
388
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
389 $ hg log -GT "{node}: {desc}\n"
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
390 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
391 |
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
392 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
393
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
394
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
395 Make sure existing shares still works
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
396
46238
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
397 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-warn-outdated-shares=false
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
398 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
399 |
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
400 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
401
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
402
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
403 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
46004
49b4ab1d9f5e share: show warning if share is outdated while source supports share-safe
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 46003
diff changeset
404 warning: source repository supports share-safe functionality. Reshare to upgrade.
46002
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
405 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
406 |
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
407 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45827
diff changeset
408
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
409
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
410
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
411 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
412
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
413 $ cd ..
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
414 $ 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
415 updating working directory
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
416 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
417 $ cd ss-share
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
418 $ hg log -GT "{node}: {desc}\n"
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
419 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
420 |
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
421 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
422
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
423 $ cd ../non-share-safe
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 Test that downgrading works too
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
426
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
427 $ cat >> $HGRCPATH <<EOF
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
428 > [extensions]
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
429 > share =
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
430 > [format]
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
431 > exp-share-safe = False
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
432 > EOF
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
433
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
434 $ hg debugupgraderepo -q
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
435 requirements
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
436 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
437 removed: exp-sharesafe
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
438
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
439 processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
440 - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
441 - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
442 - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
443
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
444 $ hg debugupgraderepo -q --run
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
445 upgrade will perform the following actions:
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
446
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
447 requirements
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
448 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
449 removed: exp-sharesafe
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
450
46035
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
451 processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
452 - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
453 - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
454 - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46004
diff changeset
455
46003
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
456 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
457
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
458 $ hg debugrequirements
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
459 dotencode
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
460 fncache
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
461 generaldelta
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
462 revlogv1
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
463 sparserevlog
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
464 store
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
465
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
466 $ cat .hg/requires
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
467 dotencode
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
468 fncache
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
469 generaldelta
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
470 revlogv1
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
471 sparserevlog
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
472 store
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
473
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
474 $ test -f .hg/store/requires
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
475 [1]
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
476
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
477 $ hg log -GT "{node}: {desc}\n"
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
478 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
479 |
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
480 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
481
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
482
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
483 Make sure existing shares still works
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
484
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
485 $ 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
486 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
487 |
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
488 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
489
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
490
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
491 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
492 abort: share source does not support exp-sharesafe requirement
c6a1fa42e325 upgrade: add support to downgrade share safe mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46002
diff changeset
493 [255]
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
494
46236
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
495 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
496
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
497 $ touch ../ss-share/.hg/wlock
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
498 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
499 abort: failed to downgrade share, got error: Lock held
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
500 [255]
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
501 $ rm ../ss-share/.hg/wlock
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
502
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
503 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
504 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
505 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
506 |
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
507 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
508
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
509
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
510 $ 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
511 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
512 |
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
513 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
514
eec47efe219d sharesafe: add functionality to automatically downgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46235
diff changeset
515
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
516
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
517 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
518
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
519 $ hg debugupgraderepo -q --run --config format.exp-share-safe=True
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
520 upgrade will perform the following actions:
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
521
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
522 requirements
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
523 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
524 added: exp-sharesafe
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
525
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
526 processed revlogs:
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
527 - all-filelogs
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
528 - changelog
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
529 - manifest
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
530
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
531 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
532 $ hg debugrequirements
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
533 dotencode
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
534 exp-sharesafe
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
535 fncache
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
536 generaldelta
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
537 revlogv1
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
538 sparserevlog
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
539 store
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
540 $ 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
541 warning: source repository supports share-safe functionality. Reshare to upgrade.
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
542 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
543 |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
544 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
545
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 Check that if lock is taken, upgrade fails but read operation are successful
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
548 $ touch ../nss-share/.hg/wlock
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
549 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
550 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
551 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
552 |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
553 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
554
46238
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
555
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
556 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-warn-outdated-shares=false
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
557 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
558 |
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
559 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
560
9796cf108e4e sharesafe: make warning about outdated share configurable
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46236
diff changeset
561
46239
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
562 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-auto-upgrade-fail-error=true
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
563 abort: failed to upgrade share, got error: Lock held
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
564 [255]
d159d0fafa78 sharesafe: introduce config to disallow outdated shares if upgrade fails
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46238
diff changeset
565
46235
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
566 $ rm ../nss-share/.hg/wlock
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
567 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
568 repository upgraded to use share-safe mode
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
569 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
570 |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
571 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
572
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 Test that unshare works
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
575
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
576 $ hg unshare -R ../nss-share
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
577 $ 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
578 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
579 |
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
580 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
0babe12ef35d sharesafe: introduce functionality to automatically upgrade shares
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46035
diff changeset
581