##// END OF EJS Templates
remotefilelog: include file contents in bundles produced during strip...
Kyle Lippincott -
r47606:47a95277 default
parent child Browse files
Show More
@@ -215,6 +215,8 b" configitem(b'remotefilelog', b'pullprefe"
215 215 configitem(b'remotefilelog', b'backgroundprefetch', default=False)
216 216 configitem(b'remotefilelog', b'prefetchdelay', default=120)
217 217 configitem(b'remotefilelog', b'prefetchdays', default=14)
218 # Other values include 'local' or 'none'. Any unrecognized value is 'all'.
219 configitem(b'remotefilelog', b'strip.includefiles', default='all')
218 220
219 221 configitem(b'remotefilelog', b'getfilesstep', default=10000)
220 222 configitem(b'remotefilelog', b'getfilestype', default=b'optimistic')
@@ -104,6 +104,18 b' class shallowcg1packer(changegroup.cgpac'
104 104 if source == b"push" or source == b"bundle":
105 105 return AllFiles
106 106
107 # We won't actually strip the files, but we should put them in any
108 # backup bundle generated by strip (especially for cases like narrow's
109 # `hg tracked --removeinclude`, as failing to do so means that the
110 # "saved" changesets during a strip won't have their files reapplied and
111 # thus their linknode adjusted, if necessary).
112 if source == b"strip":
113 cfg = repo.ui.config(b'remotefilelog', b'strip.includefiles')
114 if cfg == b'local':
115 return LocalFiles
116 elif cfg != b'none':
117 return AllFiles
118
107 119 caps = self._bundlecaps or []
108 120 if source == b"serve" or source == b"pull":
109 121 if constants.BUNDLE2_CAPABLITY in caps:
@@ -63,6 +63,7 b''
63 63 > EOF
64 64 $ hg strip tip
65 65 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
66 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
66 67
67 68 $ clearcache
68 69 $ hg pull
@@ -26,12 +26,12 b' Unbundling a shallow bundle'
26 26 $ hg strip -r 66ee28d0328c
27 27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 28 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg (glob)
29 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
29 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
30 30 $ hg unbundle .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
31 31 adding changesets
32 32 adding manifests
33 33 adding file changes
34 added 2 changesets with 0 changes to 0 files
34 added 2 changesets with 2 changes to 1 files
35 35 new changesets 66ee28d0328c:16db62c5946f
36 36 (run 'hg update' to get a working copy)
37 37
@@ -51,7 +51,7 b' Unbundling a full bundle'
51 51
52 52 Pulling from a shallow bundle
53 53
54 $ hg strip -r 66ee28d0328c
54 $ hg strip -r 66ee28d0328c --config remotefilelog.strip.includefiles=none
55 55 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg (glob)
56 56 $ hg pull -r 66ee28d0328c .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
57 57 pulling from .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
@@ -63,12 +63,13 b' Pulling from a shallow bundle'
63 63 new changesets 66ee28d0328c (1 drafts)
64 64 (run 'hg update' to get a working copy)
65 65
66 Pulling from a full bundle
66 Pulling from a full bundle, also testing that strip produces a full bundle by
67 default.
67 68
68 69 $ hg strip -r 66ee28d0328c
69 70 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg (glob)
70 $ hg pull -r 66ee28d0328c ../fullbundle.hg
71 pulling from ../fullbundle.hg
71 $ hg pull -r 66ee28d0328c .hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg
72 pulling from .hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg
72 73 searching for changes
73 74 abort: cannot pull from full bundles
74 75 (use `hg unbundle` instead)
@@ -116,7 +116,7 b''
116 116 $ hg strip -r .
117 117 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 118 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/19edf50f4de7-df3d0f74-backup.hg (glob)
119 4 files fetched over 2 fetches - (4 misses, 0.00% hit ratio) over *s (glob)
119 3 files fetched over 2 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
120 120
121 121 # unbundle
122 122
@@ -133,13 +133,14 b''
133 133 adding changesets
134 134 adding manifests
135 135 adding file changes
136 added 1 changesets with 0 changes to 0 files
136 added 1 changesets with 3 changes to 3 files
137 137 new changesets 19edf50f4de7 (1 drafts)
138 138 (run 'hg update' to get a working copy)
139 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
139 140
140 141 $ hg up
141 142 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over *s (glob)
143 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
143 144 $ cat a
144 145 a
145 146
@@ -148,7 +149,7 b''
148 149 $ clearcache
149 150 $ hg revert -r .~2 y z
150 151 no changes needed to z
151 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
152 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
152 153 $ hg checkout -C -r . -q
153 154
154 155 # explicit bundle should produce full bundle file
@@ -159,7 +160,7 b''
159 160 $ cd ..
160 161
161 162 $ hgcloneshallow ssh://user@dummy/master shallow2 -q
162 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
163 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
163 164 $ cd shallow2
164 165 $ hg unbundle ../local.bundle
165 166 adding changesets
@@ -86,6 +86,7 b''
86 86 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
87 87 $ hg strip tip
88 88 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
89 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
89 90
90 91 $ clearcache
91 92 $ hg pull
@@ -48,6 +48,7 b''
48 48 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
49 49 $ hg strip tip
50 50 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/876b1317060d-b2e91d8d-backup.hg (glob)
51 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
51 52
52 53 $ hg debugsparse --delete z
53 54
@@ -60,8 +60,9 b''
60 60 |
61 61 @ 0 b292c1e3311f
62 62
63 FIXME: This should point to a commit that actually exists in the repo. Otherwise
64 remotefilelog has to search every commit in the repository looking for a valid
65 linkrev every time it's queried, such as during push.
63 Demonstrate that the linknode points to a commit that is actually in the repo
64 after the strip operation. Otherwise remotefilelog has to search every commit in
65 the repository looking for a valid linkrev every time it's queried, such as
66 during push.
66 67 $ hg debug-file-linknode -r 70494d a
67 df91f74b871e064c89afa1fe9e2f66afa2c125df
68 70494d7ec5ef6cd3cd6939a9fd2812f9956bf553
General Comments 0
You need to be logged in to leave comments. Login now