##// 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 configitem(b'remotefilelog', b'backgroundprefetch', default=False)
215 configitem(b'remotefilelog', b'backgroundprefetch', default=False)
216 configitem(b'remotefilelog', b'prefetchdelay', default=120)
216 configitem(b'remotefilelog', b'prefetchdelay', default=120)
217 configitem(b'remotefilelog', b'prefetchdays', default=14)
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 configitem(b'remotefilelog', b'getfilesstep', default=10000)
221 configitem(b'remotefilelog', b'getfilesstep', default=10000)
220 configitem(b'remotefilelog', b'getfilestype', default=b'optimistic')
222 configitem(b'remotefilelog', b'getfilestype', default=b'optimistic')
@@ -104,6 +104,18 b' class shallowcg1packer(changegroup.cgpac'
104 if source == b"push" or source == b"bundle":
104 if source == b"push" or source == b"bundle":
105 return AllFiles
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 caps = self._bundlecaps or []
119 caps = self._bundlecaps or []
108 if source == b"serve" or source == b"pull":
120 if source == b"serve" or source == b"pull":
109 if constants.BUNDLE2_CAPABLITY in caps:
121 if constants.BUNDLE2_CAPABLITY in caps:
@@ -63,6 +63,7 b''
63 > EOF
63 > EOF
64 $ hg strip tip
64 $ hg strip tip
65 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
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 $ clearcache
68 $ clearcache
68 $ hg pull
69 $ hg pull
@@ -26,12 +26,12 b' Unbundling a shallow bundle'
26 $ hg strip -r 66ee28d0328c
26 $ hg strip -r 66ee28d0328c
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg (glob)
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 $ hg unbundle .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
30 $ hg unbundle .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
31 adding changesets
31 adding changesets
32 adding manifests
32 adding manifests
33 adding file changes
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 new changesets 66ee28d0328c:16db62c5946f
35 new changesets 66ee28d0328c:16db62c5946f
36 (run 'hg update' to get a working copy)
36 (run 'hg update' to get a working copy)
37
37
@@ -51,7 +51,7 b' Unbundling a full bundle'
51
51
52 Pulling from a shallow bundle
52 Pulling from a shallow bundle
53
53
54 $ hg strip -r 66ee28d0328c
54 $ hg strip -r 66ee28d0328c --config remotefilelog.strip.includefiles=none
55 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg (glob)
55 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg (glob)
56 $ hg pull -r 66ee28d0328c .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
56 $ hg pull -r 66ee28d0328c .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
57 pulling from .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
57 pulling from .hg/strip-backup/66ee28d0328c-3d7aafd1-backup.hg
@@ -63,12 +63,13 b' Pulling from a shallow bundle'
63 new changesets 66ee28d0328c (1 drafts)
63 new changesets 66ee28d0328c (1 drafts)
64 (run 'hg update' to get a working copy)
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 $ hg strip -r 66ee28d0328c
69 $ hg strip -r 66ee28d0328c
69 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg (glob)
70 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg (glob)
70 $ hg pull -r 66ee28d0328c ../fullbundle.hg
71 $ hg pull -r 66ee28d0328c .hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg
71 pulling from ../fullbundle.hg
72 pulling from .hg/strip-backup/66ee28d0328c-b6ee89e7-backup.hg
72 searching for changes
73 searching for changes
73 abort: cannot pull from full bundles
74 abort: cannot pull from full bundles
74 (use `hg unbundle` instead)
75 (use `hg unbundle` instead)
@@ -116,7 +116,7 b''
116 $ hg strip -r .
116 $ hg strip -r .
117 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
117 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/19edf50f4de7-df3d0f74-backup.hg (glob)
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 # unbundle
121 # unbundle
122
122
@@ -133,13 +133,14 b''
133 adding changesets
133 adding changesets
134 adding manifests
134 adding manifests
135 adding file changes
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 new changesets 19edf50f4de7 (1 drafts)
137 new changesets 19edf50f4de7 (1 drafts)
138 (run 'hg update' to get a working copy)
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 $ hg up
141 $ hg up
141 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
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 $ cat a
144 $ cat a
144 a
145 a
145
146
@@ -148,7 +149,7 b''
148 $ clearcache
149 $ clearcache
149 $ hg revert -r .~2 y z
150 $ hg revert -r .~2 y z
150 no changes needed to z
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 $ hg checkout -C -r . -q
153 $ hg checkout -C -r . -q
153
154
154 # explicit bundle should produce full bundle file
155 # explicit bundle should produce full bundle file
@@ -159,7 +160,7 b''
159 $ cd ..
160 $ cd ..
160
161
161 $ hgcloneshallow ssh://user@dummy/master shallow2 -q
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 $ cd shallow2
164 $ cd shallow2
164 $ hg unbundle ../local.bundle
165 $ hg unbundle ../local.bundle
165 adding changesets
166 adding changesets
@@ -86,6 +86,7 b''
86 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
86 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
87 $ hg strip tip
87 $ hg strip tip
88 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
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 $ clearcache
91 $ clearcache
91 $ hg pull
92 $ hg pull
@@ -48,6 +48,7 b''
48 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
48 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
49 $ hg strip tip
49 $ hg strip tip
50 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/876b1317060d-b2e91d8d-backup.hg (glob)
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 $ hg debugsparse --delete z
53 $ hg debugsparse --delete z
53
54
@@ -60,8 +60,9 b''
60 |
60 |
61 @ 0 b292c1e3311f
61 @ 0 b292c1e3311f
62
62
63 FIXME: This should point to a commit that actually exists in the repo. Otherwise
63 Demonstrate that the linknode points to a commit that is actually in the repo
64 remotefilelog has to search every commit in the repository looking for a valid
64 after the strip operation. Otherwise remotefilelog has to search every commit in
65 linkrev every time it's queried, such as during push.
65 the repository looking for a valid linkrev every time it's queried, such as
66 during push.
66 $ hg debug-file-linknode -r 70494d a
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