Mercurial > hg
comparison tests/test-share-safe.t @ 45483:d252f51ab032
share: introduce config option to store requires in .hg/store
This introduces a config option which enabled stores the requirements on a
repository in store instead.
When enabled, `.hg/requires` will contain the `share-safe` requirement which
marks that the requirements are present in the store.
This is done so that repository requirements can be shared with shares made
using `hg share` command.
After this patch, `hg share` checks whether the source repository has
share-safe requirement, if yes, it does not copy the requirements.
Test for the new functionality is added and a test case in exitsing share tests
is also added.
Differential Revision: https://phab.mercurial-scm.org/D8633
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 14 Apr 2020 21:07:09 +0530 |
parents | |
children | b71858b42963 |
comparison
equal
deleted
inserted
replaced
45482:9a99ab8217bd | 45483:d252f51ab032 |
---|---|
1 setup | |
2 | |
3 $ cat >> $HGRCPATH <<EOF | |
4 > [extensions] | |
5 > share = | |
6 > [format] | |
7 > exp-share-safe = True | |
8 > EOF | |
9 | |
10 prepare source repo | |
11 | |
12 $ hg init source | |
13 $ cd source | |
14 $ cat .hg/requires | |
15 exp-sharesafe | |
16 $ cat .hg/store/requires | |
17 dotencode | |
18 fncache | |
19 generaldelta | |
20 revlogv1 | |
21 sparserevlog | |
22 store | |
23 $ hg debugrequirements | |
24 dotencode | |
25 exp-sharesafe | |
26 fncache | |
27 generaldelta | |
28 revlogv1 | |
29 sparserevlog | |
30 store | |
31 | |
32 $ echo a > a | |
33 $ hg ci -Aqm "added a" | |
34 $ echo b > b | |
35 $ hg ci -Aqm "added b" | |
36 $ cd .. | |
37 | |
38 Create a shared repo and check the requirements are shared and read correctly | |
39 $ hg share source shared1 | |
40 updating working directory | |
41 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 $ cd shared1 | |
43 $ cat .hg/requires | |
44 exp-sharesafe | |
45 shared | |
46 | |
47 $ hg debugrequirements -R ../source | |
48 dotencode | |
49 exp-sharesafe | |
50 fncache | |
51 generaldelta | |
52 revlogv1 | |
53 sparserevlog | |
54 store | |
55 | |
56 $ hg debugrequirements | |
57 dotencode | |
58 exp-sharesafe | |
59 fncache | |
60 generaldelta | |
61 revlogv1 | |
62 shared | |
63 sparserevlog | |
64 store | |
65 | |
66 $ echo c > c | |
67 $ hg ci -Aqm "added c" | |
68 | |
69 $ hg unshare |