comparison tests/test-share-bookmarks.t @ 42325:526750cdd02d

bookmarks: keep bookmarks in .hg/store if new config set Bookmarks storage consists of two parts: (1) the set of bookmarks and their positions, and (2) the current bookmark. The former can get updated by exchange, while the latter cannot. However, they are both stored in directly .hg/ and protected by repo.wlock(). As a result, ugly workarounds were needed. This patch introduces a new config option to store the set of bookmarks and their positions in .hg/store/ but still storing the current bookmark directory in .hg/. The config option only takes effect at repo creation time. It results in a new requirement being set. Differential Revision: https://phab.mercurial-scm.org/D6387
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 15 May 2019 22:09:02 -0700
parents 314056e438a9
children dc457177dbc1
comparison
equal deleted inserted replaced
42319:b162229ebe0d 42325:526750cdd02d
1 #testcases vfs svfs
2
1 $ echo "[extensions]" >> $HGRCPATH 3 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "share = " >> $HGRCPATH 4 $ echo "share = " >> $HGRCPATH
5
6 #if svfs
7 $ echo "[format]" >> $HGRCPATH
8 $ echo "bookmarks-in-store = yes " >> $HGRCPATH
9 #endif
3 10
4 prepare repo1 11 prepare repo1
5 12
6 $ hg init repo1 13 $ hg init repo1
7 $ cd repo1 14 $ cd repo1
31 $ hg bookmarks 38 $ hg bookmarks
32 * bm1 2:c2e0ac586386 39 * bm1 2:c2e0ac586386
33 $ cd ../repo2 40 $ cd ../repo2
34 $ hg book bm2 41 $ hg book bm2
35 $ hg bookmarks 42 $ hg bookmarks
43 bm1 2:c2e0ac586386 (svfs !)
36 * bm2 2:c2e0ac586386 44 * bm2 2:c2e0ac586386
37 $ cd ../repo3 45 $ cd ../repo3
38 $ hg bookmarks 46 $ hg bookmarks
39 bm1 2:c2e0ac586386 47 bm1 2:c2e0ac586386
48 bm2 2:c2e0ac586386 (svfs !)
40 $ hg book bm3 49 $ hg book bm3
41 $ hg bookmarks 50 $ hg bookmarks
42 bm1 2:c2e0ac586386 51 bm1 2:c2e0ac586386
52 bm2 2:c2e0ac586386 (svfs !)
43 * bm3 2:c2e0ac586386 53 * bm3 2:c2e0ac586386
44 $ cd ../repo1 54 $ cd ../repo1
45 $ hg bookmarks 55 $ hg bookmarks
46 * bm1 2:c2e0ac586386 56 * bm1 2:c2e0ac586386
57 bm2 2:c2e0ac586386 (svfs !)
47 bm3 2:c2e0ac586386 58 bm3 2:c2e0ac586386
48 59
49 check whether HG_PENDING makes pending changes only in relatd 60 check whether HG_PENDING makes pending changes only in relatd
50 repositories visible to an external hook. 61 repositories visible to an external hook.
51 62
68 79
69 $ cd ../repo1 80 $ cd ../repo1
70 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX 81 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
71 @repo1 82 @repo1
72 bm1 2:c2e0ac586386 83 bm1 2:c2e0ac586386
84 bm2 2:c2e0ac586386 (svfs !)
73 bm3 2:c2e0ac586386 85 bm3 2:c2e0ac586386
74 * bmX 2:c2e0ac586386 86 * bmX 2:c2e0ac586386
75 @repo2 87 @repo2
88 bm1 2:c2e0ac586386 (svfs !)
76 * bm2 2:c2e0ac586386 89 * bm2 2:c2e0ac586386
90 bm3 2:c2e0ac586386 (svfs !)
77 @repo3 91 @repo3
78 bm1 2:c2e0ac586386 92 bm1 2:c2e0ac586386
93 bm2 2:c2e0ac586386 (svfs !)
79 * bm3 2:c2e0ac586386 94 * bm3 2:c2e0ac586386
80 bmX 2:c2e0ac586386 95 bmX 2:c2e0ac586386 (vfs !)
81 transaction abort! 96 transaction abort!
82 rollback completed 97 rollback completed
83 abort: pretxnclose hook exited with status 1 98 abort: pretxnclose hook exited with status 1
84 [255] 99 [255]
85 $ hg book bm1 100 $ hg book bm1
90 105
91 $ cd ../repo3 106 $ cd ../repo3
92 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX 107 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
93 @repo1 108 @repo1
94 * bm1 2:c2e0ac586386 109 * bm1 2:c2e0ac586386
110 bm2 2:c2e0ac586386 (svfs !)
95 bm3 2:c2e0ac586386 111 bm3 2:c2e0ac586386
96 @repo2 112 @repo2
113 bm1 2:c2e0ac586386 (svfs !)
97 * bm2 2:c2e0ac586386 114 * bm2 2:c2e0ac586386
115 bm3 2:c2e0ac586386 (svfs !)
98 @repo3 116 @repo3
99 bm1 2:c2e0ac586386 117 bm1 2:c2e0ac586386
118 bm2 2:c2e0ac586386 (svfs !)
100 bm3 2:c2e0ac586386 119 bm3 2:c2e0ac586386
101 * bmX 2:c2e0ac586386 120 * bmX 2:c2e0ac586386
102 transaction abort! 121 transaction abort!
103 rollback completed 122 rollback completed
104 abort: pretxnclose hook exited with status 1 123 abort: pretxnclose hook exited with status 1
105 [255] 124 [255]
106 $ hg book bm3 125 $ hg book bm3
126
127 clean up bm2 since it's uninteresting (not shared in the vfs case and
128 same as bm3 in the svfs case)
129 $ cd ../repo2
130 $ hg book -d bm2
107 131
108 $ cd ../repo1 132 $ cd ../repo1
109 133
110 test that commits work 134 test that commits work
111 135