##// END OF EJS Templates
upgrade: don't perform anything if nothing to do...
Pulkit Goyal -
r46848:d3113c4c default
parent child Browse files
Show More
@@ -1,231 +1,234 b''
1 # upgrade.py - functions for in place upgrade of Mercurial repository
1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 #
2 #
3 # Copyright (c) 2016-present, Gregory Szorc
3 # Copyright (c) 2016-present, Gregory Szorc
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from . import (
11 from . import (
12 error,
12 error,
13 hg,
13 hg,
14 localrepo,
14 localrepo,
15 pycompat,
15 pycompat,
16 )
16 )
17
17
18 from .upgrade_utils import (
18 from .upgrade_utils import (
19 actions as upgrade_actions,
19 actions as upgrade_actions,
20 engine as upgrade_engine,
20 engine as upgrade_engine,
21 )
21 )
22
22
23 allformatvariant = upgrade_actions.allformatvariant
23 allformatvariant = upgrade_actions.allformatvariant
24
24
25
25
26 def upgraderepo(
26 def upgraderepo(
27 ui,
27 ui,
28 repo,
28 repo,
29 run=False,
29 run=False,
30 optimize=None,
30 optimize=None,
31 backup=True,
31 backup=True,
32 manifest=None,
32 manifest=None,
33 changelog=None,
33 changelog=None,
34 filelogs=None,
34 filelogs=None,
35 ):
35 ):
36 """Upgrade a repository in place."""
36 """Upgrade a repository in place."""
37 if optimize is None:
37 if optimize is None:
38 optimize = {}
38 optimize = {}
39 repo = repo.unfiltered()
39 repo = repo.unfiltered()
40
40
41 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
41 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
42 specentries = (
42 specentries = (
43 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
43 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
44 (upgrade_engine.UPGRADE_MANIFEST, manifest),
44 (upgrade_engine.UPGRADE_MANIFEST, manifest),
45 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
45 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
46 )
46 )
47 specified = [(y, x) for (y, x) in specentries if x is not None]
47 specified = [(y, x) for (y, x) in specentries if x is not None]
48 if specified:
48 if specified:
49 # we have some limitation on revlogs to be recloned
49 # we have some limitation on revlogs to be recloned
50 if any(x for y, x in specified):
50 if any(x for y, x in specified):
51 revlogs = set()
51 revlogs = set()
52 for upgrade, enabled in specified:
52 for upgrade, enabled in specified:
53 if enabled:
53 if enabled:
54 revlogs.add(upgrade)
54 revlogs.add(upgrade)
55 else:
55 else:
56 # none are enabled
56 # none are enabled
57 for upgrade, __ in specified:
57 for upgrade, __ in specified:
58 revlogs.discard(upgrade)
58 revlogs.discard(upgrade)
59
59
60 # Ensure the repository can be upgraded.
60 # Ensure the repository can be upgraded.
61 upgrade_actions.check_source_requirements(repo)
61 upgrade_actions.check_source_requirements(repo)
62
62
63 default_options = localrepo.defaultcreateopts(repo.ui)
63 default_options = localrepo.defaultcreateopts(repo.ui)
64 newreqs = localrepo.newreporequirements(repo.ui, default_options)
64 newreqs = localrepo.newreporequirements(repo.ui, default_options)
65 newreqs.update(upgrade_actions.preservedrequirements(repo))
65 newreqs.update(upgrade_actions.preservedrequirements(repo))
66
66
67 upgrade_actions.check_requirements_changes(repo, newreqs)
67 upgrade_actions.check_requirements_changes(repo, newreqs)
68
68
69 # Find and validate all improvements that can be made.
69 # Find and validate all improvements that can be made.
70 alloptimizations = upgrade_actions.findoptimizations(repo)
70 alloptimizations = upgrade_actions.findoptimizations(repo)
71
71
72 # Apply and Validate arguments.
72 # Apply and Validate arguments.
73 optimizations = []
73 optimizations = []
74 for o in alloptimizations:
74 for o in alloptimizations:
75 if o.name in optimize:
75 if o.name in optimize:
76 optimizations.append(o)
76 optimizations.append(o)
77 optimize.discard(o.name)
77 optimize.discard(o.name)
78
78
79 if optimize: # anything left is unknown
79 if optimize: # anything left is unknown
80 raise error.Abort(
80 raise error.Abort(
81 _(b'unknown optimization action requested: %s')
81 _(b'unknown optimization action requested: %s')
82 % b', '.join(sorted(optimize)),
82 % b', '.join(sorted(optimize)),
83 hint=_(b'run without arguments to see valid optimizations'),
83 hint=_(b'run without arguments to see valid optimizations'),
84 )
84 )
85
85
86 format_upgrades = upgrade_actions.find_format_upgrades(repo)
86 format_upgrades = upgrade_actions.find_format_upgrades(repo)
87 up_actions = upgrade_actions.determine_upgrade_actions(
87 up_actions = upgrade_actions.determine_upgrade_actions(
88 repo, format_upgrades, optimizations, repo.requirements, newreqs
88 repo, format_upgrades, optimizations, repo.requirements, newreqs
89 )
89 )
90 removed_actions = upgrade_actions.find_format_downgrades(repo)
90 removed_actions = upgrade_actions.find_format_downgrades(repo)
91
91
92 removedreqs = repo.requirements - newreqs
92 removedreqs = repo.requirements - newreqs
93 addedreqs = newreqs - repo.requirements
93 addedreqs = newreqs - repo.requirements
94
94
95 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
95 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
96 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
96 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
97 removedreqs | addedreqs
97 removedreqs | addedreqs
98 )
98 )
99 if incompatible:
99 if incompatible:
100 msg = _(
100 msg = _(
101 b'ignoring revlogs selection flags, format requirements '
101 b'ignoring revlogs selection flags, format requirements '
102 b'change: %s\n'
102 b'change: %s\n'
103 )
103 )
104 ui.warn(msg % b', '.join(sorted(incompatible)))
104 ui.warn(msg % b', '.join(sorted(incompatible)))
105 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
105 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
106
106
107 upgrade_op = upgrade_actions.UpgradeOperation(
107 upgrade_op = upgrade_actions.UpgradeOperation(
108 ui,
108 ui,
109 newreqs,
109 newreqs,
110 repo.requirements,
110 repo.requirements,
111 up_actions,
111 up_actions,
112 removed_actions,
112 removed_actions,
113 revlogs,
113 revlogs,
114 )
114 )
115
115
116 if not run:
116 if not run:
117 fromconfig = []
117 fromconfig = []
118 onlydefault = []
118 onlydefault = []
119
119
120 for d in format_upgrades:
120 for d in format_upgrades:
121 if d.fromconfig(repo):
121 if d.fromconfig(repo):
122 fromconfig.append(d)
122 fromconfig.append(d)
123 elif d.default:
123 elif d.default:
124 onlydefault.append(d)
124 onlydefault.append(d)
125
125
126 if fromconfig or onlydefault:
126 if fromconfig or onlydefault:
127
127
128 if fromconfig:
128 if fromconfig:
129 ui.status(
129 ui.status(
130 _(
130 _(
131 b'repository lacks features recommended by '
131 b'repository lacks features recommended by '
132 b'current config options:\n\n'
132 b'current config options:\n\n'
133 )
133 )
134 )
134 )
135 for i in fromconfig:
135 for i in fromconfig:
136 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
136 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
137
137
138 if onlydefault:
138 if onlydefault:
139 ui.status(
139 ui.status(
140 _(
140 _(
141 b'repository lacks features used by the default '
141 b'repository lacks features used by the default '
142 b'config options:\n\n'
142 b'config options:\n\n'
143 )
143 )
144 )
144 )
145 for i in onlydefault:
145 for i in onlydefault:
146 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
146 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
147
147
148 ui.status(b'\n')
148 ui.status(b'\n')
149 else:
149 else:
150 ui.status(_(b'(no format upgrades found in existing repository)\n'))
150 ui.status(_(b'(no format upgrades found in existing repository)\n'))
151
151
152 ui.status(
152 ui.status(
153 _(
153 _(
154 b'performing an upgrade with "--run" will make the following '
154 b'performing an upgrade with "--run" will make the following '
155 b'changes:\n\n'
155 b'changes:\n\n'
156 )
156 )
157 )
157 )
158
158
159 upgrade_op.print_requirements()
159 upgrade_op.print_requirements()
160 upgrade_op.print_optimisations()
160 upgrade_op.print_optimisations()
161 upgrade_op.print_upgrade_actions()
161 upgrade_op.print_upgrade_actions()
162 upgrade_op.print_affected_revlogs()
162 upgrade_op.print_affected_revlogs()
163
163
164 if upgrade_op.unused_optimizations:
164 if upgrade_op.unused_optimizations:
165 ui.status(
165 ui.status(
166 _(
166 _(
167 b'additional optimizations are available by specifying '
167 b'additional optimizations are available by specifying '
168 b'"--optimize <name>":\n\n'
168 b'"--optimize <name>":\n\n'
169 )
169 )
170 )
170 )
171 upgrade_op.print_unused_optimizations()
171 upgrade_op.print_unused_optimizations()
172 return
172 return
173
173
174 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions):
175 ui.status(_(b'nothing to do\n'))
176 return
174 # Else we're in the run=true case.
177 # Else we're in the run=true case.
175 ui.write(_(b'upgrade will perform the following actions:\n\n'))
178 ui.write(_(b'upgrade will perform the following actions:\n\n'))
176 upgrade_op.print_requirements()
179 upgrade_op.print_requirements()
177 upgrade_op.print_optimisations()
180 upgrade_op.print_optimisations()
178 upgrade_op.print_upgrade_actions()
181 upgrade_op.print_upgrade_actions()
179 upgrade_op.print_affected_revlogs()
182 upgrade_op.print_affected_revlogs()
180
183
181 ui.status(_(b'beginning upgrade...\n'))
184 ui.status(_(b'beginning upgrade...\n'))
182 with repo.wlock(), repo.lock():
185 with repo.wlock(), repo.lock():
183 ui.status(_(b'repository locked and read-only\n'))
186 ui.status(_(b'repository locked and read-only\n'))
184 # Our strategy for upgrading the repository is to create a new,
187 # Our strategy for upgrading the repository is to create a new,
185 # temporary repository, write data to it, then do a swap of the
188 # temporary repository, write data to it, then do a swap of the
186 # data. There are less heavyweight ways to do this, but it is easier
189 # data. There are less heavyweight ways to do this, but it is easier
187 # to create a new repo object than to instantiate all the components
190 # to create a new repo object than to instantiate all the components
188 # (like the store) separately.
191 # (like the store) separately.
189 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
192 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
190 backuppath = None
193 backuppath = None
191 try:
194 try:
192 ui.status(
195 ui.status(
193 _(
196 _(
194 b'creating temporary repository to stage upgraded '
197 b'creating temporary repository to stage upgraded '
195 b'data: %s\n'
198 b'data: %s\n'
196 )
199 )
197 % tmppath
200 % tmppath
198 )
201 )
199
202
200 # clone ui without using ui.copy because repo.ui is protected
203 # clone ui without using ui.copy because repo.ui is protected
201 repoui = repo.ui.__class__(repo.ui)
204 repoui = repo.ui.__class__(repo.ui)
202 dstrepo = hg.repository(repoui, path=tmppath, create=True)
205 dstrepo = hg.repository(repoui, path=tmppath, create=True)
203
206
204 with dstrepo.wlock(), dstrepo.lock():
207 with dstrepo.wlock(), dstrepo.lock():
205 backuppath = upgrade_engine.upgrade(
208 backuppath = upgrade_engine.upgrade(
206 ui, repo, dstrepo, upgrade_op
209 ui, repo, dstrepo, upgrade_op
207 )
210 )
208 if not backup:
211 if not backup:
209 ui.status(
212 ui.status(
210 _(b'removing old repository content %s\n') % backuppath
213 _(b'removing old repository content %s\n') % backuppath
211 )
214 )
212 repo.vfs.rmtree(backuppath, forcibly=True)
215 repo.vfs.rmtree(backuppath, forcibly=True)
213 backuppath = None
216 backuppath = None
214
217
215 finally:
218 finally:
216 ui.status(_(b'removing temporary repository %s\n') % tmppath)
219 ui.status(_(b'removing temporary repository %s\n') % tmppath)
217 repo.vfs.rmtree(tmppath, forcibly=True)
220 repo.vfs.rmtree(tmppath, forcibly=True)
218
221
219 if backuppath and not ui.quiet:
222 if backuppath and not ui.quiet:
220 ui.warn(
223 ui.warn(
221 _(b'copy of old repository backed up at %s\n') % backuppath
224 _(b'copy of old repository backed up at %s\n') % backuppath
222 )
225 )
223 ui.warn(
226 ui.warn(
224 _(
227 _(
225 b'the old repository will not be deleted; remove '
228 b'the old repository will not be deleted; remove '
226 b'it to free up disk space once the upgraded '
229 b'it to free up disk space once the upgraded '
227 b'repository is verified\n'
230 b'repository is verified\n'
228 )
231 )
229 )
232 )
230
233
231 upgrade_op.print_post_op_messages()
234 upgrade_op.print_post_op_messages()
@@ -1,703 +1,693 b''
1 #testcases lfsremote-on lfsremote-off
1 #testcases lfsremote-on lfsremote-off
2 #require serve no-reposimplestore no-chg
2 #require serve no-reposimplestore no-chg
3
3
4 This test splits `hg serve` with and without using the extension into separate
4 This test splits `hg serve` with and without using the extension into separate
5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
7 indicates whether or not the extension is loaded. The "X" cases are not tested
7 indicates whether or not the extension is loaded. The "X" cases are not tested
8 individually, because the lfs requirement causes the process to bail early if
8 individually, because the lfs requirement causes the process to bail early if
9 the extension is disabled.
9 the extension is disabled.
10
10
11 . Server
11 . Server
12 .
12 .
13 . No-LFS LFS
13 . No-LFS LFS
14 . +----------------------------+
14 . +----------------------------+
15 . | || D | E | D | E |
15 . | || D | E | D | E |
16 . |---++=======================|
16 . |---++=======================|
17 . C | D || N/A | #1 | X | #4 |
17 . C | D || N/A | #1 | X | #4 |
18 . l No +---++-----------------------|
18 . l No +---++-----------------------|
19 . i LFS | E || #2 | #2 | X | #5 |
19 . i LFS | E || #2 | #2 | X | #5 |
20 . e +---++-----------------------|
20 . e +---++-----------------------|
21 . n | D || X | X | X | X |
21 . n | D || X | X | X | X |
22 . t LFS |---++-----------------------|
22 . t LFS |---++-----------------------|
23 . | E || #3 | #3 | X | #6 |
23 . | E || #3 | #3 | X | #6 |
24 . |---++-----------------------+
24 . |---++-----------------------+
25
25
26 make command server magic visible
26 make command server magic visible
27
27
28 #if windows
28 #if windows
29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
30 #else
30 #else
31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
32 #endif
32 #endif
33 $ export PYTHONPATH
33 $ export PYTHONPATH
34
34
35 $ hg init server
35 $ hg init server
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
37
37
38 $ cat > $TESTTMP/debugprocessors.py <<EOF
38 $ cat > $TESTTMP/debugprocessors.py <<EOF
39 > from mercurial import (
39 > from mercurial import (
40 > cmdutil,
40 > cmdutil,
41 > commands,
41 > commands,
42 > pycompat,
42 > pycompat,
43 > registrar,
43 > registrar,
44 > )
44 > )
45 > cmdtable = {}
45 > cmdtable = {}
46 > command = registrar.command(cmdtable)
46 > command = registrar.command(cmdtable)
47 > @command(b'debugprocessors', [], b'FILE')
47 > @command(b'debugprocessors', [], b'FILE')
48 > def debugprocessors(ui, repo, file_=None, **opts):
48 > def debugprocessors(ui, repo, file_=None, **opts):
49 > opts = pycompat.byteskwargs(opts)
49 > opts = pycompat.byteskwargs(opts)
50 > opts[b'changelog'] = False
50 > opts[b'changelog'] = False
51 > opts[b'manifest'] = False
51 > opts[b'manifest'] = False
52 > opts[b'dir'] = False
52 > opts[b'dir'] = False
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
54 > for flag, proc in rl._flagprocessors.items():
54 > for flag, proc in rl._flagprocessors.items():
55 > ui.status(b"registered processor '%#x'\n" % (flag))
55 > ui.status(b"registered processor '%#x'\n" % (flag))
56 > EOF
56 > EOF
57
57
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
59 first, and causes an "abort: no common changegroup version" if the extension is
59 first, and causes an "abort: no common changegroup version" if the extension is
60 only loaded on one side. If that *is* enabled, the subsequent failure is "abort:
60 only loaded on one side. If that *is* enabled, the subsequent failure is "abort:
61 missing processor for flag '0x2000'!" if the extension is only loaded on one side
61 missing processor for flag '0x2000'!" if the extension is only loaded on one side
62 (possibly also masked by the Internal Server Error message).
62 (possibly also masked by the Internal Server Error message).
63 $ cat >> $HGRCPATH <<EOF
63 $ cat >> $HGRCPATH <<EOF
64 > [extensions]
64 > [extensions]
65 > debugprocessors = $TESTTMP/debugprocessors.py
65 > debugprocessors = $TESTTMP/debugprocessors.py
66 > [experimental]
66 > [experimental]
67 > lfs.disableusercache = True
67 > lfs.disableusercache = True
68 > lfs.worker-enable = False
68 > lfs.worker-enable = False
69 > [lfs]
69 > [lfs]
70 > threshold=10
70 > threshold=10
71 > [web]
71 > [web]
72 > allow_push=*
72 > allow_push=*
73 > push_ssl=False
73 > push_ssl=False
74 > EOF
74 > EOF
75
75
76 $ cp $HGRCPATH $HGRCPATH.orig
76 $ cp $HGRCPATH $HGRCPATH.orig
77
77
78 #if lfsremote-on
78 #if lfsremote-on
79 $ hg --config extensions.lfs= -R server \
79 $ hg --config extensions.lfs= -R server \
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
81 #else
81 #else
82 $ hg --config extensions.lfs=! -R server \
82 $ hg --config extensions.lfs=! -R server \
83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
84 #endif
84 #endif
85
85
86 $ cat hg.pid >> $DAEMON_PIDS
86 $ cat hg.pid >> $DAEMON_PIDS
87 $ hg clone -q http://localhost:$HGPORT client
87 $ hg clone -q http://localhost:$HGPORT client
88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
89 [1]
89 [1]
90
90
91 This trivial repo will force commandserver to load the extension, but not call
91 This trivial repo will force commandserver to load the extension, but not call
92 reposetup() on another repo actually being operated on. This gives coverage
92 reposetup() on another repo actually being operated on. This gives coverage
93 that wrapper functions are not assuming reposetup() was called.
93 that wrapper functions are not assuming reposetup() was called.
94
94
95 $ hg init $TESTTMP/cmdservelfs
95 $ hg init $TESTTMP/cmdservelfs
96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
97 > [extensions]
97 > [extensions]
98 > lfs =
98 > lfs =
99 > EOF
99 > EOF
100
100
101 --------------------------------------------------------------------------------
101 --------------------------------------------------------------------------------
102 Case #1: client with non-lfs content and the extension disabled; server with
102 Case #1: client with non-lfs content and the extension disabled; server with
103 non-lfs content, and the extension enabled.
103 non-lfs content, and the extension enabled.
104
104
105 $ cd client
105 $ cd client
106 $ echo 'non-lfs' > nonlfs.txt
106 $ echo 'non-lfs' > nonlfs.txt
107 >>> from __future__ import absolute_import
107 >>> from __future__ import absolute_import
108 >>> from hgclient import check, readchannel, runcommand
108 >>> from hgclient import check, readchannel, runcommand
109 >>> @check
109 >>> @check
110 ... def diff(server):
110 ... def diff(server):
111 ... readchannel(server)
111 ... readchannel(server)
112 ... # run an arbitrary command in the repo with the extension loaded
112 ... # run an arbitrary command in the repo with the extension loaded
113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
114 ... # now run a command in a repo without the extension to ensure that
114 ... # now run a command in a repo without the extension to ensure that
115 ... # files are added safely..
115 ... # files are added safely..
116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
119 ... # .. and that debugupgraderepo safely no-ops.
119 ... # .. and that debugupgraderepo safely no-ops.
120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
121 *** runcommand id -R ../cmdservelfs
121 *** runcommand id -R ../cmdservelfs
122 000000000000 tip
122 000000000000 tip
123 *** runcommand ci -Aqm non-lfs
123 *** runcommand ci -Aqm non-lfs
124 *** runcommand diff -r .~1
124 *** runcommand diff -r .~1
125 diff -r 000000000000 nonlfs.txt
125 diff -r 000000000000 nonlfs.txt
126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
128 @@ -0,0 +1,1 @@
128 @@ -0,0 +1,1 @@
129 +non-lfs
129 +non-lfs
130 *** runcommand debugupgraderepo -q --run
130 *** runcommand debugupgraderepo -q --run
131 upgrade will perform the following actions:
132
133 requirements
134 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
135
136 processed revlogs:
137 - all-filelogs
138 - changelog
139 - manifest
140
141
131
142 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
132 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
143 [1]
133 [1]
144
134
145 #if lfsremote-on
135 #if lfsremote-on
146
136
147 $ hg push -q
137 $ hg push -q
148 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
138 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
149 [1]
139 [1]
150
140
151 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
141 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
152 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
142 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
153 [1]
143 [1]
154
144
155 $ hg init $TESTTMP/client1_pull
145 $ hg init $TESTTMP/client1_pull
156 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
146 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
157 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
147 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
158 [1]
148 [1]
159
149
160 $ hg identify http://localhost:$HGPORT
150 $ hg identify http://localhost:$HGPORT
161 d437e1d24fbd
151 d437e1d24fbd
162
152
163 #endif
153 #endif
164
154
165 --------------------------------------------------------------------------------
155 --------------------------------------------------------------------------------
166 Case #2: client with non-lfs content and the extension enabled; server with
156 Case #2: client with non-lfs content and the extension enabled; server with
167 non-lfs content, and the extension state controlled by #testcases.
157 non-lfs content, and the extension state controlled by #testcases.
168
158
169 $ cat >> $HGRCPATH <<EOF
159 $ cat >> $HGRCPATH <<EOF
170 > [extensions]
160 > [extensions]
171 > lfs =
161 > lfs =
172 > EOF
162 > EOF
173 $ echo 'non-lfs' > nonlfs2.txt
163 $ echo 'non-lfs' > nonlfs2.txt
174 $ hg ci -Aqm 'non-lfs file with lfs client'
164 $ hg ci -Aqm 'non-lfs file with lfs client'
175
165
176 Since no lfs content has been added yet, the push is allowed, even when the
166 Since no lfs content has been added yet, the push is allowed, even when the
177 extension is not enabled remotely.
167 extension is not enabled remotely.
178
168
179 $ hg push -q
169 $ hg push -q
180 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
170 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
181 [1]
171 [1]
182
172
183 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
173 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
184 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
174 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
185 [1]
175 [1]
186
176
187 $ hg init $TESTTMP/client2_pull
177 $ hg init $TESTTMP/client2_pull
188 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
178 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
189 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
179 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
190 [1]
180 [1]
191
181
192 $ hg identify http://localhost:$HGPORT
182 $ hg identify http://localhost:$HGPORT
193 1477875038c6
183 1477875038c6
194
184
195 --------------------------------------------------------------------------------
185 --------------------------------------------------------------------------------
196 Case #3: client with lfs content and the extension enabled; server with
186 Case #3: client with lfs content and the extension enabled; server with
197 non-lfs content, and the extension state controlled by #testcases. The server
187 non-lfs content, and the extension state controlled by #testcases. The server
198 should have an 'lfs' requirement after it picks up its first commit with a blob.
188 should have an 'lfs' requirement after it picks up its first commit with a blob.
199
189
200 $ echo 'this is a big lfs file' > lfs.bin
190 $ echo 'this is a big lfs file' > lfs.bin
201 $ hg ci -Aqm 'lfs'
191 $ hg ci -Aqm 'lfs'
202 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
192 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
203 .hg/requires:lfs
193 .hg/requires:lfs
204
194
205 #if lfsremote-off
195 #if lfsremote-off
206 $ hg push -q
196 $ hg push -q
207 abort: required features are not supported in the destination: lfs
197 abort: required features are not supported in the destination: lfs
208 (enable the lfs extension on the server)
198 (enable the lfs extension on the server)
209 [255]
199 [255]
210 #else
200 #else
211 $ hg push -q
201 $ hg push -q
212 #endif
202 #endif
213 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
203 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
214 .hg/requires:lfs
204 .hg/requires:lfs
215 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
205 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
216
206
217 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
207 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
218 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
208 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
219 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
209 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
220 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
210 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
221
211
222 $ hg init $TESTTMP/client3_pull
212 $ hg init $TESTTMP/client3_pull
223 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
213 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
224 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
214 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
225 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
215 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
226 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
216 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
227
217
228 Test that the commit/changegroup requirement check hook can be run multiple
218 Test that the commit/changegroup requirement check hook can be run multiple
229 times.
219 times.
230
220
231 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
221 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
232
222
233 $ cd ../cmdserve_client3
223 $ cd ../cmdserve_client3
234
224
235 >>> from __future__ import absolute_import
225 >>> from __future__ import absolute_import
236 >>> from hgclient import check, readchannel, runcommand
226 >>> from hgclient import check, readchannel, runcommand
237 >>> @check
227 >>> @check
238 ... def addrequirement(server):
228 ... def addrequirement(server):
239 ... readchannel(server)
229 ... readchannel(server)
240 ... # change the repo in a way that adds the lfs requirement
230 ... # change the repo in a way that adds the lfs requirement
241 ... runcommand(server, [b'pull', b'-qu'])
231 ... runcommand(server, [b'pull', b'-qu'])
242 ... # Now cause the requirement adding hook to fire again, without going
232 ... # Now cause the requirement adding hook to fire again, without going
243 ... # through reposetup() again.
233 ... # through reposetup() again.
244 ... with open('file.txt', 'wb') as fp:
234 ... with open('file.txt', 'wb') as fp:
245 ... fp.write(b'data')
235 ... fp.write(b'data')
246 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
236 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
247 *** runcommand pull -qu
237 *** runcommand pull -qu
248 *** runcommand ci -Aqm non-lfs
238 *** runcommand ci -Aqm non-lfs
249
239
250 $ cd ../client
240 $ cd ../client
251
241
252 The difference here is the push failed above when the extension isn't
242 The difference here is the push failed above when the extension isn't
253 enabled on the server.
243 enabled on the server.
254 $ hg identify http://localhost:$HGPORT
244 $ hg identify http://localhost:$HGPORT
255 8374dc4052cb (lfsremote-on !)
245 8374dc4052cb (lfsremote-on !)
256 1477875038c6 (lfsremote-off !)
246 1477875038c6 (lfsremote-off !)
257
247
258 Don't bother testing the lfsremote-off cases- the server won't be able
248 Don't bother testing the lfsremote-off cases- the server won't be able
259 to launch if there's lfs content and the extension is disabled.
249 to launch if there's lfs content and the extension is disabled.
260
250
261 #if lfsremote-on
251 #if lfsremote-on
262
252
263 --------------------------------------------------------------------------------
253 --------------------------------------------------------------------------------
264 Case #4: client with non-lfs content and the extension disabled; server with
254 Case #4: client with non-lfs content and the extension disabled; server with
265 lfs content, and the extension enabled.
255 lfs content, and the extension enabled.
266
256
267 $ cat >> $HGRCPATH <<EOF
257 $ cat >> $HGRCPATH <<EOF
268 > [extensions]
258 > [extensions]
269 > lfs = !
259 > lfs = !
270 > EOF
260 > EOF
271
261
272 $ hg init $TESTTMP/client4
262 $ hg init $TESTTMP/client4
273 $ cd $TESTTMP/client4
263 $ cd $TESTTMP/client4
274 $ cat >> .hg/hgrc <<EOF
264 $ cat >> .hg/hgrc <<EOF
275 > [paths]
265 > [paths]
276 > default = http://localhost:$HGPORT
266 > default = http://localhost:$HGPORT
277 > EOF
267 > EOF
278 $ echo 'non-lfs' > nonlfs2.txt
268 $ echo 'non-lfs' > nonlfs2.txt
279 $ hg ci -Aqm 'non-lfs'
269 $ hg ci -Aqm 'non-lfs'
280 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
270 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
281 $TESTTMP/server/.hg/requires:lfs
271 $TESTTMP/server/.hg/requires:lfs
282
272
283 $ hg push -q --force
273 $ hg push -q --force
284 warning: repository is unrelated
274 warning: repository is unrelated
285 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
275 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
286 $TESTTMP/server/.hg/requires:lfs
276 $TESTTMP/server/.hg/requires:lfs
287
277
288 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
278 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
289 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
279 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
290 abort: repository requires features unknown to this Mercurial: lfs
280 abort: repository requires features unknown to this Mercurial: lfs
291 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
281 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
292 [255]
282 [255]
293 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
283 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
294 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
284 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
295 $TESTTMP/server/.hg/requires:lfs
285 $TESTTMP/server/.hg/requires:lfs
296 [2]
286 [2]
297
287
298 TODO: fail more gracefully.
288 TODO: fail more gracefully.
299
289
300 $ hg init $TESTTMP/client4_pull
290 $ hg init $TESTTMP/client4_pull
301 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
291 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
302 pulling from http://localhost:$HGPORT/
292 pulling from http://localhost:$HGPORT/
303 requesting all changes
293 requesting all changes
304 remote: abort: no common changegroup version
294 remote: abort: no common changegroup version
305 abort: pull failed on remote
295 abort: pull failed on remote
306 [255]
296 [255]
307 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
297 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
308 $TESTTMP/server/.hg/requires:lfs
298 $TESTTMP/server/.hg/requires:lfs
309
299
310 $ hg identify http://localhost:$HGPORT
300 $ hg identify http://localhost:$HGPORT
311 03b080fa9d93
301 03b080fa9d93
312
302
313 --------------------------------------------------------------------------------
303 --------------------------------------------------------------------------------
314 Case #5: client with non-lfs content and the extension enabled; server with
304 Case #5: client with non-lfs content and the extension enabled; server with
315 lfs content, and the extension enabled.
305 lfs content, and the extension enabled.
316
306
317 $ cat >> $HGRCPATH <<EOF
307 $ cat >> $HGRCPATH <<EOF
318 > [extensions]
308 > [extensions]
319 > lfs =
309 > lfs =
320 > EOF
310 > EOF
321 $ echo 'non-lfs' > nonlfs3.txt
311 $ echo 'non-lfs' > nonlfs3.txt
322 $ hg ci -Aqm 'non-lfs file with lfs client'
312 $ hg ci -Aqm 'non-lfs file with lfs client'
323
313
324 $ hg push -q
314 $ hg push -q
325 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
315 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
326 $TESTTMP/server/.hg/requires:lfs
316 $TESTTMP/server/.hg/requires:lfs
327
317
328 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
318 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
329 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
319 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
330 $TESTTMP/client5_clone/.hg/requires:lfs
320 $TESTTMP/client5_clone/.hg/requires:lfs
331 $TESTTMP/server/.hg/requires:lfs
321 $TESTTMP/server/.hg/requires:lfs
332
322
333 $ hg init $TESTTMP/client5_pull
323 $ hg init $TESTTMP/client5_pull
334 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
324 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
335 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
325 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
336 $TESTTMP/client5_pull/.hg/requires:lfs
326 $TESTTMP/client5_pull/.hg/requires:lfs
337 $TESTTMP/server/.hg/requires:lfs
327 $TESTTMP/server/.hg/requires:lfs
338
328
339 $ hg identify http://localhost:$HGPORT
329 $ hg identify http://localhost:$HGPORT
340 c729025cc5e3
330 c729025cc5e3
341
331
342 $ mv $HGRCPATH $HGRCPATH.tmp
332 $ mv $HGRCPATH $HGRCPATH.tmp
343 $ cp $HGRCPATH.orig $HGRCPATH
333 $ cp $HGRCPATH.orig $HGRCPATH
344
334
345 >>> from __future__ import absolute_import
335 >>> from __future__ import absolute_import
346 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
336 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
347 >>> @check
337 >>> @check
348 ... def checkflags(server):
338 ... def checkflags(server):
349 ... readchannel(server)
339 ... readchannel(server)
350 ... bprint(b'')
340 ... bprint(b'')
351 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
341 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
352 ... stdout.flush()
342 ... stdout.flush()
353 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
343 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
354 ... b'../server'])
344 ... b'../server'])
355 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
345 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
356 ... b'../server'])
346 ... b'../server'])
357 ... runcommand(server, [b'config', b'extensions', b'--cwd',
347 ... runcommand(server, [b'config', b'extensions', b'--cwd',
358 ... b'../server'])
348 ... b'../server'])
359 ...
349 ...
360 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
350 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
361 ... stdout.flush()
351 ... stdout.flush()
362 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
352 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
363 ... runcommand(server, [b'config', b'extensions'])
353 ... runcommand(server, [b'config', b'extensions'])
364
354
365 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
355 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
366 *** runcommand debugprocessors lfs.bin -R ../server
356 *** runcommand debugprocessors lfs.bin -R ../server
367 registered processor '0x8000'
357 registered processor '0x8000'
368 registered processor '0x800'
358 registered processor '0x800'
369 registered processor '0x2000'
359 registered processor '0x2000'
370 *** runcommand debugprocessors nonlfs2.txt -R ../server
360 *** runcommand debugprocessors nonlfs2.txt -R ../server
371 registered processor '0x8000'
361 registered processor '0x8000'
372 registered processor '0x800'
362 registered processor '0x800'
373 registered processor '0x2000'
363 registered processor '0x2000'
374 *** runcommand config extensions --cwd ../server
364 *** runcommand config extensions --cwd ../server
375 extensions.debugprocessors=$TESTTMP/debugprocessors.py
365 extensions.debugprocessors=$TESTTMP/debugprocessors.py
376 extensions.lfs=
366 extensions.lfs=
377
367
378 # LFS not enabled- revlogs don't have 0x2000 flag
368 # LFS not enabled- revlogs don't have 0x2000 flag
379 *** runcommand debugprocessors nonlfs3.txt
369 *** runcommand debugprocessors nonlfs3.txt
380 registered processor '0x8000'
370 registered processor '0x8000'
381 registered processor '0x800'
371 registered processor '0x800'
382 *** runcommand config extensions
372 *** runcommand config extensions
383 extensions.debugprocessors=$TESTTMP/debugprocessors.py
373 extensions.debugprocessors=$TESTTMP/debugprocessors.py
384
374
385 $ rm $HGRCPATH
375 $ rm $HGRCPATH
386 $ mv $HGRCPATH.tmp $HGRCPATH
376 $ mv $HGRCPATH.tmp $HGRCPATH
387
377
388 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
378 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
389 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
379 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
390 > [extensions]
380 > [extensions]
391 > lfs = !
381 > lfs = !
392 > EOF
382 > EOF
393
383
394 >>> from __future__ import absolute_import, print_function
384 >>> from __future__ import absolute_import, print_function
395 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
385 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
396 >>> @check
386 >>> @check
397 ... def checkflags2(server):
387 ... def checkflags2(server):
398 ... readchannel(server)
388 ... readchannel(server)
399 ... bprint(b'')
389 ... bprint(b'')
400 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
390 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
401 ... stdout.flush()
391 ... stdout.flush()
402 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
392 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
403 ... b'../server'])
393 ... b'../server'])
404 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
394 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
405 ... b'../server'])
395 ... b'../server'])
406 ... runcommand(server, [b'config', b'extensions', b'--cwd',
396 ... runcommand(server, [b'config', b'extensions', b'--cwd',
407 ... b'../server'])
397 ... b'../server'])
408 ...
398 ...
409 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
399 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
410 ... stdout.flush()
400 ... stdout.flush()
411 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
401 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
412 ... runcommand(server, [b'config', b'extensions'])
402 ... runcommand(server, [b'config', b'extensions'])
413 ...
403 ...
414 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
404 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
415 ... stdout.flush()
405 ... stdout.flush()
416 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
406 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
417 ... b'../nonlfs'])
407 ... b'../nonlfs'])
418 ... runcommand(server, [b'config', b'extensions', b'--cwd',
408 ... runcommand(server, [b'config', b'extensions', b'--cwd',
419 ... b'../nonlfs'])
409 ... b'../nonlfs'])
420
410
421 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
411 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
422 *** runcommand debugprocessors lfs.bin -R ../server
412 *** runcommand debugprocessors lfs.bin -R ../server
423 registered processor '0x8000'
413 registered processor '0x8000'
424 registered processor '0x800'
414 registered processor '0x800'
425 registered processor '0x2000'
415 registered processor '0x2000'
426 *** runcommand debugprocessors nonlfs2.txt -R ../server
416 *** runcommand debugprocessors nonlfs2.txt -R ../server
427 registered processor '0x8000'
417 registered processor '0x8000'
428 registered processor '0x800'
418 registered processor '0x800'
429 registered processor '0x2000'
419 registered processor '0x2000'
430 *** runcommand config extensions --cwd ../server
420 *** runcommand config extensions --cwd ../server
431 extensions.debugprocessors=$TESTTMP/debugprocessors.py
421 extensions.debugprocessors=$TESTTMP/debugprocessors.py
432 extensions.lfs=
422 extensions.lfs=
433
423
434 # LFS enabled without requirement- revlogs have 0x2000 flag
424 # LFS enabled without requirement- revlogs have 0x2000 flag
435 *** runcommand debugprocessors nonlfs3.txt
425 *** runcommand debugprocessors nonlfs3.txt
436 registered processor '0x8000'
426 registered processor '0x8000'
437 registered processor '0x800'
427 registered processor '0x800'
438 registered processor '0x2000'
428 registered processor '0x2000'
439 *** runcommand config extensions
429 *** runcommand config extensions
440 extensions.debugprocessors=$TESTTMP/debugprocessors.py
430 extensions.debugprocessors=$TESTTMP/debugprocessors.py
441 extensions.lfs=
431 extensions.lfs=
442
432
443 # LFS disabled locally- revlogs don't have 0x2000 flag
433 # LFS disabled locally- revlogs don't have 0x2000 flag
444 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
434 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
445 registered processor '0x8000'
435 registered processor '0x8000'
446 registered processor '0x800'
436 registered processor '0x800'
447 *** runcommand config extensions --cwd ../nonlfs
437 *** runcommand config extensions --cwd ../nonlfs
448 extensions.debugprocessors=$TESTTMP/debugprocessors.py
438 extensions.debugprocessors=$TESTTMP/debugprocessors.py
449 extensions.lfs=!
439 extensions.lfs=!
450
440
451 --------------------------------------------------------------------------------
441 --------------------------------------------------------------------------------
452 Case #6: client with lfs content and the extension enabled; server with
442 Case #6: client with lfs content and the extension enabled; server with
453 lfs content, and the extension enabled.
443 lfs content, and the extension enabled.
454
444
455 $ echo 'this is another lfs file' > lfs2.txt
445 $ echo 'this is another lfs file' > lfs2.txt
456 $ hg ci -Aqm 'lfs file with lfs client'
446 $ hg ci -Aqm 'lfs file with lfs client'
457
447
458 $ hg --config paths.default= push -v http://localhost:$HGPORT
448 $ hg --config paths.default= push -v http://localhost:$HGPORT
459 pushing to http://localhost:$HGPORT/
449 pushing to http://localhost:$HGPORT/
460 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
450 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
461 searching for changes
451 searching for changes
462 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
452 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
463 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
453 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
464 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
454 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
465 lfs: uploaded 1 files (25 bytes)
455 lfs: uploaded 1 files (25 bytes)
466 1 changesets found
456 1 changesets found
467 uncompressed size of bundle content:
457 uncompressed size of bundle content:
468 206 (changelog)
458 206 (changelog)
469 172 (manifests)
459 172 (manifests)
470 275 lfs2.txt
460 275 lfs2.txt
471 remote: adding changesets
461 remote: adding changesets
472 remote: adding manifests
462 remote: adding manifests
473 remote: adding file changes
463 remote: adding file changes
474 remote: added 1 changesets with 1 changes to 1 files
464 remote: added 1 changesets with 1 changes to 1 files
475 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
465 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
476 .hg/requires:lfs
466 .hg/requires:lfs
477 $TESTTMP/server/.hg/requires:lfs
467 $TESTTMP/server/.hg/requires:lfs
478
468
479 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
469 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
480 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
470 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
481 $TESTTMP/client6_clone/.hg/requires:lfs
471 $TESTTMP/client6_clone/.hg/requires:lfs
482 $TESTTMP/server/.hg/requires:lfs
472 $TESTTMP/server/.hg/requires:lfs
483
473
484 $ hg init $TESTTMP/client6_pull
474 $ hg init $TESTTMP/client6_pull
485 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
475 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
486 pulling from http://localhost:$HGPORT/
476 pulling from http://localhost:$HGPORT/
487 requesting all changes
477 requesting all changes
488 adding changesets
478 adding changesets
489 adding manifests
479 adding manifests
490 adding file changes
480 adding file changes
491 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
481 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
492 added 6 changesets with 5 changes to 5 files (+1 heads)
482 added 6 changesets with 5 changes to 5 files (+1 heads)
493 new changesets d437e1d24fbd:d3b84d50eacb
483 new changesets d437e1d24fbd:d3b84d50eacb
494 resolving manifests
484 resolving manifests
495 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
485 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
496 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
486 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
497 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
487 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
498 lfs: downloaded 1 files (25 bytes)
488 lfs: downloaded 1 files (25 bytes)
499 getting lfs2.txt
489 getting lfs2.txt
500 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
490 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
501 getting nonlfs2.txt
491 getting nonlfs2.txt
502 getting nonlfs3.txt
492 getting nonlfs3.txt
503 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
493 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 updated to "d3b84d50eacb: lfs file with lfs client"
494 updated to "d3b84d50eacb: lfs file with lfs client"
505 1 other heads for branch "default"
495 1 other heads for branch "default"
506 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
496 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
507 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
497 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
508 $TESTTMP/client6_pull/.hg/requires:lfs
498 $TESTTMP/client6_pull/.hg/requires:lfs
509 $TESTTMP/server/.hg/requires:lfs
499 $TESTTMP/server/.hg/requires:lfs
510
500
511 $ hg identify http://localhost:$HGPORT
501 $ hg identify http://localhost:$HGPORT
512 d3b84d50eacb
502 d3b84d50eacb
513
503
514 --------------------------------------------------------------------------------
504 --------------------------------------------------------------------------------
515 Misc: process dies early if a requirement exists and the extension is disabled
505 Misc: process dies early if a requirement exists and the extension is disabled
516
506
517 $ hg --config extensions.lfs=! summary
507 $ hg --config extensions.lfs=! summary
518 abort: repository requires features unknown to this Mercurial: lfs
508 abort: repository requires features unknown to this Mercurial: lfs
519 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
509 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
520 [255]
510 [255]
521
511
522 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
512 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
523 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
513 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
524 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
514 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
525 $ hg -R $TESTTMP/client6_clone push -q
515 $ hg -R $TESTTMP/client6_clone push -q
526
516
527 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
517 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
528
518
529 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
519 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
530
520
531 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
521 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
532 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
522 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
533 version https://git-lfs.github.com/spec/v1
523 version https://git-lfs.github.com/spec/v1
534 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
524 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
535 size 20
525 size 20
536 x-is-binary 0
526 x-is-binary 0
537
527
538 lfspair1.bin
528 lfspair1.bin
539
529
540 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
530 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
541 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
531 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
542 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
532 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
543 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
533 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
544 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
534 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
545 lfs: downloaded 1 files (20 bytes)
535 lfs: downloaded 1 files (20 bytes)
546 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
536 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
547
537
548 {
538 {
549 "data": "this is an lfs file\n",
539 "data": "this is an lfs file\n",
550 "path": "lfspair1.bin",
540 "path": "lfspair1.bin",
551 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
541 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
552 }
542 }
553 ]
543 ]
554
544
555 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
545 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
556
546
557 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
547 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
558 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
548 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
559 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
549 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
560 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
550 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
561 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
551 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
562 lfs: downloaded 1 files (20 bytes)
552 lfs: downloaded 1 files (20 bytes)
563 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
553 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
564 this is an lfs file
554 this is an lfs file
565
555
566 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
556 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
567 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
557 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
568 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
558 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
569 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
559 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
570 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
560 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
571 lfs: downloaded 1 files (24 bytes)
561 lfs: downloaded 1 files (24 bytes)
572 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
562 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
573 this is an lfs file too
563 this is an lfs file too
574
564
575 Export will prefetch all needed files across all needed revisions
565 Export will prefetch all needed files across all needed revisions
576
566
577 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
567 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
578 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
568 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
579 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
569 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
580 exporting patches:
570 exporting patches:
581 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
571 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
582 lfs: need to transfer 4 objects (92 bytes)
572 lfs: need to transfer 4 objects (92 bytes)
583 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
573 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
584 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
574 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
585 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
575 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
586 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
576 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
587 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
577 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
588 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
578 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
589 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
579 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
590 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
580 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
591 lfs: downloaded 4 files (92 bytes)
581 lfs: downloaded 4 files (92 bytes)
592 all.export
582 all.export
593 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
583 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
594 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
584 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
595 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
585 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
596 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
586 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
597
587
598 Export with selected files is used with `extdiff --patch`
588 Export with selected files is used with `extdiff --patch`
599
589
600 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
590 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
601 $ hg --config extensions.extdiff= \
591 $ hg --config extensions.extdiff= \
602 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
592 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
603 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
593 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
604 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
594 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
605 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
595 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
606 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
596 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
607 lfs: downloaded 1 files (23 bytes)
597 lfs: downloaded 1 files (23 bytes)
608 */hg-8374dc4052cb.patch (glob)
598 */hg-8374dc4052cb.patch (glob)
609 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
599 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
610 */hg-9640b57e77b1.patch (glob)
600 */hg-9640b57e77b1.patch (glob)
611 --- */hg-8374dc4052cb.patch * (glob)
601 --- */hg-8374dc4052cb.patch * (glob)
612 +++ */hg-9640b57e77b1.patch * (glob)
602 +++ */hg-9640b57e77b1.patch * (glob)
613 @@ -2,12 +2,7 @@
603 @@ -2,12 +2,7 @@
614 # User test
604 # User test
615 # Date 0 0
605 # Date 0 0
616 # Thu Jan 01 00:00:00 1970 +0000
606 # Thu Jan 01 00:00:00 1970 +0000
617 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
607 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
618 -# Parent 1477875038c60152e391238920a16381c627b487
608 -# Parent 1477875038c60152e391238920a16381c627b487
619 -lfs
609 -lfs
620 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
610 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
621 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
611 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
622 +add lfs pair
612 +add lfs pair
623
613
624 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
614 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
625 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
615 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
626 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
616 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
627 -@@ -0,0 +1,1 @@
617 -@@ -0,0 +1,1 @@
628 -+this is a big lfs file
618 -+this is a big lfs file
629 cleaning up temp directory
619 cleaning up temp directory
630 [1]
620 [1]
631
621
632 Diff will prefetch files
622 Diff will prefetch files
633
623
634 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
624 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
635 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
625 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
636 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
626 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
637 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
627 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
638 lfs: need to transfer 4 objects (92 bytes)
628 lfs: need to transfer 4 objects (92 bytes)
639 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
629 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
640 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
630 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
641 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
631 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
642 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
632 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
643 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
633 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
644 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
634 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
645 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
635 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
646 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
636 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
647 lfs: downloaded 4 files (92 bytes)
637 lfs: downloaded 4 files (92 bytes)
648 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
638 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
649 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
639 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
650 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
640 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
651 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
641 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
652 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
642 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
653 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
643 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
654 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
644 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
655 @@ -1,1 +0,0 @@
645 @@ -1,1 +0,0 @@
656 -this is a big lfs file
646 -this is a big lfs file
657 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
647 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
658 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
648 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
659 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
649 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
660 @@ -0,0 +1,1 @@
650 @@ -0,0 +1,1 @@
661 +this is another lfs file
651 +this is another lfs file
662 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
652 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
663 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
653 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
664 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
654 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
665 @@ -0,0 +1,1 @@
655 @@ -0,0 +1,1 @@
666 +this is an lfs file
656 +this is an lfs file
667 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
657 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
668 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
658 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
669 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
659 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
670 @@ -0,0 +1,1 @@
660 @@ -0,0 +1,1 @@
671 +this is an lfs file too
661 +this is an lfs file too
672 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
662 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
673 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
663 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
674 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
664 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
675 @@ -1,1 +0,0 @@
665 @@ -1,1 +0,0 @@
676 -non-lfs
666 -non-lfs
677 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
667 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
678 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
668 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
679 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
669 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
680 @@ -0,0 +1,1 @@
670 @@ -0,0 +1,1 @@
681 +non-lfs
671 +non-lfs
682
672
683 Only the files required by diff are prefetched
673 Only the files required by diff are prefetched
684
674
685 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
675 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
686 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
676 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
687 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
677 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
688 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
678 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
689 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
679 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
690 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
680 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
691 lfs: downloaded 1 files (24 bytes)
681 lfs: downloaded 1 files (24 bytes)
692 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
682 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
693 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
683 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
694 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
684 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
695 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
685 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
696 @@ -0,0 +1,1 @@
686 @@ -0,0 +1,1 @@
697 +this is an lfs file too
687 +this is an lfs file too
698
688
699 #endif
689 #endif
700
690
701 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
691 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
702
692
703 $ cat $TESTTMP/errors.log
693 $ cat $TESTTMP/errors.log
@@ -1,1685 +1,1527 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > EOF
6 > EOF
7
7
8 store and revlogv1 are required in source
8 store and revlogv1 are required in source
9
9
10 $ hg --config format.usestore=false init no-store
10 $ hg --config format.usestore=false init no-store
11 $ hg -R no-store debugupgraderepo
11 $ hg -R no-store debugupgraderepo
12 abort: cannot upgrade repository; requirement missing: store
12 abort: cannot upgrade repository; requirement missing: store
13 [255]
13 [255]
14
14
15 $ hg init no-revlogv1
15 $ hg init no-revlogv1
16 $ cat > no-revlogv1/.hg/requires << EOF
16 $ cat > no-revlogv1/.hg/requires << EOF
17 > dotencode
17 > dotencode
18 > fncache
18 > fncache
19 > generaldelta
19 > generaldelta
20 > store
20 > store
21 > EOF
21 > EOF
22
22
23 $ hg -R no-revlogv1 debugupgraderepo
23 $ hg -R no-revlogv1 debugupgraderepo
24 abort: cannot upgrade repository; requirement missing: revlogv1
24 abort: cannot upgrade repository; requirement missing: revlogv1
25 [255]
25 [255]
26
26
27 Cannot upgrade shared repositories
27 Cannot upgrade shared repositories
28
28
29 $ hg init share-parent
29 $ hg init share-parent
30 $ hg -q share share-parent share-child
30 $ hg -q share share-parent share-child
31
31
32 $ hg -R share-child debugupgraderepo
32 $ hg -R share-child debugupgraderepo
33 abort: cannot upgrade repository; unsupported source requirement: shared
33 abort: cannot upgrade repository; unsupported source requirement: shared
34 [255]
34 [255]
35
35
36 Do not yet support upgrading treemanifest repos
36 Do not yet support upgrading treemanifest repos
37
37
38 $ hg --config experimental.treemanifest=true init treemanifest
38 $ hg --config experimental.treemanifest=true init treemanifest
39 $ hg -R treemanifest debugupgraderepo
39 $ hg -R treemanifest debugupgraderepo
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
41 [255]
41 [255]
42
42
43 Cannot add treemanifest requirement during upgrade
43 Cannot add treemanifest requirement during upgrade
44
44
45 $ hg init disallowaddedreq
45 $ hg init disallowaddedreq
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
48 [255]
48 [255]
49
49
50 An upgrade of a repository created with recommended settings only suggests optimizations
50 An upgrade of a repository created with recommended settings only suggests optimizations
51
51
52 $ hg init empty
52 $ hg init empty
53 $ cd empty
53 $ cd empty
54 $ hg debugformat
54 $ hg debugformat
55 format-variant repo
55 format-variant repo
56 fncache: yes
56 fncache: yes
57 dotencode: yes
57 dotencode: yes
58 generaldelta: yes
58 generaldelta: yes
59 exp-sharesafe: no
59 exp-sharesafe: no
60 sparserevlog: yes
60 sparserevlog: yes
61 sidedata: no
61 sidedata: no
62 persistent-nodemap: no
62 persistent-nodemap: no
63 copies-sdc: no
63 copies-sdc: no
64 plain-cl-delta: yes
64 plain-cl-delta: yes
65 compression: zlib
65 compression: zlib
66 compression-level: default
66 compression-level: default
67 $ hg debugformat --verbose
67 $ hg debugformat --verbose
68 format-variant repo config default
68 format-variant repo config default
69 fncache: yes yes yes
69 fncache: yes yes yes
70 dotencode: yes yes yes
70 dotencode: yes yes yes
71 generaldelta: yes yes yes
71 generaldelta: yes yes yes
72 exp-sharesafe: no no no
72 exp-sharesafe: no no no
73 sparserevlog: yes yes yes
73 sparserevlog: yes yes yes
74 sidedata: no no no
74 sidedata: no no no
75 persistent-nodemap: no no no
75 persistent-nodemap: no no no
76 copies-sdc: no no no
76 copies-sdc: no no no
77 plain-cl-delta: yes yes yes
77 plain-cl-delta: yes yes yes
78 compression: zlib zlib zlib
78 compression: zlib zlib zlib
79 compression-level: default default default
79 compression-level: default default default
80 $ hg debugformat --verbose --config format.usefncache=no
80 $ hg debugformat --verbose --config format.usefncache=no
81 format-variant repo config default
81 format-variant repo config default
82 fncache: yes no yes
82 fncache: yes no yes
83 dotencode: yes no yes
83 dotencode: yes no yes
84 generaldelta: yes yes yes
84 generaldelta: yes yes yes
85 exp-sharesafe: no no no
85 exp-sharesafe: no no no
86 sparserevlog: yes yes yes
86 sparserevlog: yes yes yes
87 sidedata: no no no
87 sidedata: no no no
88 persistent-nodemap: no no no
88 persistent-nodemap: no no no
89 copies-sdc: no no no
89 copies-sdc: no no no
90 plain-cl-delta: yes yes yes
90 plain-cl-delta: yes yes yes
91 compression: zlib zlib zlib
91 compression: zlib zlib zlib
92 compression-level: default default default
92 compression-level: default default default
93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
94 format-variant repo config default
94 format-variant repo config default
95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
106 $ hg debugformat -Tjson
106 $ hg debugformat -Tjson
107 [
107 [
108 {
108 {
109 "config": true,
109 "config": true,
110 "default": true,
110 "default": true,
111 "name": "fncache",
111 "name": "fncache",
112 "repo": true
112 "repo": true
113 },
113 },
114 {
114 {
115 "config": true,
115 "config": true,
116 "default": true,
116 "default": true,
117 "name": "dotencode",
117 "name": "dotencode",
118 "repo": true
118 "repo": true
119 },
119 },
120 {
120 {
121 "config": true,
121 "config": true,
122 "default": true,
122 "default": true,
123 "name": "generaldelta",
123 "name": "generaldelta",
124 "repo": true
124 "repo": true
125 },
125 },
126 {
126 {
127 "config": false,
127 "config": false,
128 "default": false,
128 "default": false,
129 "name": "exp-sharesafe",
129 "name": "exp-sharesafe",
130 "repo": false
130 "repo": false
131 },
131 },
132 {
132 {
133 "config": true,
133 "config": true,
134 "default": true,
134 "default": true,
135 "name": "sparserevlog",
135 "name": "sparserevlog",
136 "repo": true
136 "repo": true
137 },
137 },
138 {
138 {
139 "config": false,
139 "config": false,
140 "default": false,
140 "default": false,
141 "name": "sidedata",
141 "name": "sidedata",
142 "repo": false
142 "repo": false
143 },
143 },
144 {
144 {
145 "config": false,
145 "config": false,
146 "default": false,
146 "default": false,
147 "name": "persistent-nodemap",
147 "name": "persistent-nodemap",
148 "repo": false
148 "repo": false
149 },
149 },
150 {
150 {
151 "config": false,
151 "config": false,
152 "default": false,
152 "default": false,
153 "name": "copies-sdc",
153 "name": "copies-sdc",
154 "repo": false
154 "repo": false
155 },
155 },
156 {
156 {
157 "config": true,
157 "config": true,
158 "default": true,
158 "default": true,
159 "name": "plain-cl-delta",
159 "name": "plain-cl-delta",
160 "repo": true
160 "repo": true
161 },
161 },
162 {
162 {
163 "config": "zlib",
163 "config": "zlib",
164 "default": "zlib",
164 "default": "zlib",
165 "name": "compression",
165 "name": "compression",
166 "repo": "zlib"
166 "repo": "zlib"
167 },
167 },
168 {
168 {
169 "config": "default",
169 "config": "default",
170 "default": "default",
170 "default": "default",
171 "name": "compression-level",
171 "name": "compression-level",
172 "repo": "default"
172 "repo": "default"
173 }
173 }
174 ]
174 ]
175 $ hg debugupgraderepo
175 $ hg debugupgraderepo
176 (no format upgrades found in existing repository)
176 (no format upgrades found in existing repository)
177 performing an upgrade with "--run" will make the following changes:
177 performing an upgrade with "--run" will make the following changes:
178
178
179 requirements
179 requirements
180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
181
181
182 processed revlogs:
182 processed revlogs:
183 - all-filelogs
183 - all-filelogs
184 - changelog
184 - changelog
185 - manifest
185 - manifest
186
186
187 additional optimizations are available by specifying "--optimize <name>":
187 additional optimizations are available by specifying "--optimize <name>":
188
188
189 re-delta-parent
189 re-delta-parent
190 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
190 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
191
191
192 re-delta-multibase
192 re-delta-multibase
193 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
193 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
194
194
195 re-delta-all
195 re-delta-all
196 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
196 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
197
197
198 re-delta-fulladd
198 re-delta-fulladd
199 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
199 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
200
200
201
201
202 $ hg debugupgraderepo --quiet
202 $ hg debugupgraderepo --quiet
203 requirements
203 requirements
204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
205
205
206 processed revlogs:
206 processed revlogs:
207 - all-filelogs
207 - all-filelogs
208 - changelog
208 - changelog
209 - manifest
209 - manifest
210
210
211
211
212 --optimize can be used to add optimizations
212 --optimize can be used to add optimizations
213
213
214 $ hg debugupgrade --optimize 're-delta-parent'
214 $ hg debugupgrade --optimize 're-delta-parent'
215 (no format upgrades found in existing repository)
215 (no format upgrades found in existing repository)
216 performing an upgrade with "--run" will make the following changes:
216 performing an upgrade with "--run" will make the following changes:
217
217
218 requirements
218 requirements
219 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
219 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
220
220
221 optimisations: re-delta-parent
221 optimisations: re-delta-parent
222
222
223 re-delta-parent
223 re-delta-parent
224 deltas within internal storage will choose a new base revision if needed
224 deltas within internal storage will choose a new base revision if needed
225
225
226 processed revlogs:
226 processed revlogs:
227 - all-filelogs
227 - all-filelogs
228 - changelog
228 - changelog
229 - manifest
229 - manifest
230
230
231 additional optimizations are available by specifying "--optimize <name>":
231 additional optimizations are available by specifying "--optimize <name>":
232
232
233 re-delta-multibase
233 re-delta-multibase
234 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
234 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
235
235
236 re-delta-all
236 re-delta-all
237 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
237 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
238
238
239 re-delta-fulladd
239 re-delta-fulladd
240 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
240 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
241
241
242
242
243 modern form of the option
243 modern form of the option
244
244
245 $ hg debugupgrade --optimize re-delta-parent
245 $ hg debugupgrade --optimize re-delta-parent
246 (no format upgrades found in existing repository)
246 (no format upgrades found in existing repository)
247 performing an upgrade with "--run" will make the following changes:
247 performing an upgrade with "--run" will make the following changes:
248
248
249 requirements
249 requirements
250 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
250 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
251
251
252 optimisations: re-delta-parent
252 optimisations: re-delta-parent
253
253
254 re-delta-parent
254 re-delta-parent
255 deltas within internal storage will choose a new base revision if needed
255 deltas within internal storage will choose a new base revision if needed
256
256
257 processed revlogs:
257 processed revlogs:
258 - all-filelogs
258 - all-filelogs
259 - changelog
259 - changelog
260 - manifest
260 - manifest
261
261
262 additional optimizations are available by specifying "--optimize <name>":
262 additional optimizations are available by specifying "--optimize <name>":
263
263
264 re-delta-multibase
264 re-delta-multibase
265 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
265 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
266
266
267 re-delta-all
267 re-delta-all
268 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
268 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
269
269
270 re-delta-fulladd
270 re-delta-fulladd
271 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
271 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
272
272
273 $ hg debugupgrade --optimize re-delta-parent --quiet
273 $ hg debugupgrade --optimize re-delta-parent --quiet
274 requirements
274 requirements
275 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
275 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
276
276
277 optimisations: re-delta-parent
277 optimisations: re-delta-parent
278
278
279 processed revlogs:
279 processed revlogs:
280 - all-filelogs
280 - all-filelogs
281 - changelog
281 - changelog
282 - manifest
282 - manifest
283
283
284
284
285 unknown optimization:
285 unknown optimization:
286
286
287 $ hg debugupgrade --optimize foobar
287 $ hg debugupgrade --optimize foobar
288 abort: unknown optimization action requested: foobar
288 abort: unknown optimization action requested: foobar
289 (run without arguments to see valid optimizations)
289 (run without arguments to see valid optimizations)
290 [255]
290 [255]
291
291
292 Various sub-optimal detections work
292 Various sub-optimal detections work
293
293
294 $ cat > .hg/requires << EOF
294 $ cat > .hg/requires << EOF
295 > revlogv1
295 > revlogv1
296 > store
296 > store
297 > EOF
297 > EOF
298
298
299 $ hg debugformat
299 $ hg debugformat
300 format-variant repo
300 format-variant repo
301 fncache: no
301 fncache: no
302 dotencode: no
302 dotencode: no
303 generaldelta: no
303 generaldelta: no
304 exp-sharesafe: no
304 exp-sharesafe: no
305 sparserevlog: no
305 sparserevlog: no
306 sidedata: no
306 sidedata: no
307 persistent-nodemap: no
307 persistent-nodemap: no
308 copies-sdc: no
308 copies-sdc: no
309 plain-cl-delta: yes
309 plain-cl-delta: yes
310 compression: zlib
310 compression: zlib
311 compression-level: default
311 compression-level: default
312 $ hg debugformat --verbose
312 $ hg debugformat --verbose
313 format-variant repo config default
313 format-variant repo config default
314 fncache: no yes yes
314 fncache: no yes yes
315 dotencode: no yes yes
315 dotencode: no yes yes
316 generaldelta: no yes yes
316 generaldelta: no yes yes
317 exp-sharesafe: no no no
317 exp-sharesafe: no no no
318 sparserevlog: no yes yes
318 sparserevlog: no yes yes
319 sidedata: no no no
319 sidedata: no no no
320 persistent-nodemap: no no no
320 persistent-nodemap: no no no
321 copies-sdc: no no no
321 copies-sdc: no no no
322 plain-cl-delta: yes yes yes
322 plain-cl-delta: yes yes yes
323 compression: zlib zlib zlib
323 compression: zlib zlib zlib
324 compression-level: default default default
324 compression-level: default default default
325 $ hg debugformat --verbose --config format.usegeneraldelta=no
325 $ hg debugformat --verbose --config format.usegeneraldelta=no
326 format-variant repo config default
326 format-variant repo config default
327 fncache: no yes yes
327 fncache: no yes yes
328 dotencode: no yes yes
328 dotencode: no yes yes
329 generaldelta: no no yes
329 generaldelta: no no yes
330 exp-sharesafe: no no no
330 exp-sharesafe: no no no
331 sparserevlog: no no yes
331 sparserevlog: no no yes
332 sidedata: no no no
332 sidedata: no no no
333 persistent-nodemap: no no no
333 persistent-nodemap: no no no
334 copies-sdc: no no no
334 copies-sdc: no no no
335 plain-cl-delta: yes yes yes
335 plain-cl-delta: yes yes yes
336 compression: zlib zlib zlib
336 compression: zlib zlib zlib
337 compression-level: default default default
337 compression-level: default default default
338 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
338 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
339 format-variant repo config default
339 format-variant repo config default
340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
348 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
348 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
349 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
349 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
350 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
350 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
351 $ hg debugupgraderepo
351 $ hg debugupgraderepo
352 repository lacks features recommended by current config options:
352 repository lacks features recommended by current config options:
353
353
354 fncache
354 fncache
355 long and reserved filenames may not work correctly; repository performance is sub-optimal
355 long and reserved filenames may not work correctly; repository performance is sub-optimal
356
356
357 dotencode
357 dotencode
358 storage of filenames beginning with a period or space may not work correctly
358 storage of filenames beginning with a period or space may not work correctly
359
359
360 generaldelta
360 generaldelta
361 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
361 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
362
362
363 sparserevlog
363 sparserevlog
364 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
364 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
365
365
366
366
367 performing an upgrade with "--run" will make the following changes:
367 performing an upgrade with "--run" will make the following changes:
368
368
369 requirements
369 requirements
370 preserved: revlogv1, store
370 preserved: revlogv1, store
371 added: dotencode, fncache, generaldelta, sparserevlog
371 added: dotencode, fncache, generaldelta, sparserevlog
372
372
373 fncache
373 fncache
374 repository will be more resilient to storing certain paths and performance of certain operations should be improved
374 repository will be more resilient to storing certain paths and performance of certain operations should be improved
375
375
376 dotencode
376 dotencode
377 repository will be better able to store files beginning with a space or period
377 repository will be better able to store files beginning with a space or period
378
378
379 generaldelta
379 generaldelta
380 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
380 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
381
381
382 sparserevlog
382 sparserevlog
383 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
383 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
384
384
385 processed revlogs:
385 processed revlogs:
386 - all-filelogs
386 - all-filelogs
387 - changelog
387 - changelog
388 - manifest
388 - manifest
389
389
390 additional optimizations are available by specifying "--optimize <name>":
390 additional optimizations are available by specifying "--optimize <name>":
391
391
392 re-delta-parent
392 re-delta-parent
393 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
393 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
394
394
395 re-delta-multibase
395 re-delta-multibase
396 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
396 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
397
397
398 re-delta-all
398 re-delta-all
399 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
399 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
400
400
401 re-delta-fulladd
401 re-delta-fulladd
402 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
402 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
403
403
404 $ hg debugupgraderepo --quiet
404 $ hg debugupgraderepo --quiet
405 requirements
405 requirements
406 preserved: revlogv1, store
406 preserved: revlogv1, store
407 added: dotencode, fncache, generaldelta, sparserevlog
407 added: dotencode, fncache, generaldelta, sparserevlog
408
408
409 processed revlogs:
409 processed revlogs:
410 - all-filelogs
410 - all-filelogs
411 - changelog
411 - changelog
412 - manifest
412 - manifest
413
413
414
414
415 $ hg --config format.dotencode=false debugupgraderepo
415 $ hg --config format.dotencode=false debugupgraderepo
416 repository lacks features recommended by current config options:
416 repository lacks features recommended by current config options:
417
417
418 fncache
418 fncache
419 long and reserved filenames may not work correctly; repository performance is sub-optimal
419 long and reserved filenames may not work correctly; repository performance is sub-optimal
420
420
421 generaldelta
421 generaldelta
422 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
422 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
423
423
424 sparserevlog
424 sparserevlog
425 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
425 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
426
426
427 repository lacks features used by the default config options:
427 repository lacks features used by the default config options:
428
428
429 dotencode
429 dotencode
430 storage of filenames beginning with a period or space may not work correctly
430 storage of filenames beginning with a period or space may not work correctly
431
431
432
432
433 performing an upgrade with "--run" will make the following changes:
433 performing an upgrade with "--run" will make the following changes:
434
434
435 requirements
435 requirements
436 preserved: revlogv1, store
436 preserved: revlogv1, store
437 added: fncache, generaldelta, sparserevlog
437 added: fncache, generaldelta, sparserevlog
438
438
439 fncache
439 fncache
440 repository will be more resilient to storing certain paths and performance of certain operations should be improved
440 repository will be more resilient to storing certain paths and performance of certain operations should be improved
441
441
442 generaldelta
442 generaldelta
443 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
443 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
444
444
445 sparserevlog
445 sparserevlog
446 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
446 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
447
447
448 processed revlogs:
448 processed revlogs:
449 - all-filelogs
449 - all-filelogs
450 - changelog
450 - changelog
451 - manifest
451 - manifest
452
452
453 additional optimizations are available by specifying "--optimize <name>":
453 additional optimizations are available by specifying "--optimize <name>":
454
454
455 re-delta-parent
455 re-delta-parent
456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
457
457
458 re-delta-multibase
458 re-delta-multibase
459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
460
460
461 re-delta-all
461 re-delta-all
462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
463
463
464 re-delta-fulladd
464 re-delta-fulladd
465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
466
466
467
467
468 $ cd ..
468 $ cd ..
469
469
470 Upgrading a repository that is already modern essentially no-ops
470 Upgrading a repository that is already modern essentially no-ops
471
471
472 $ hg init modern
472 $ hg init modern
473 $ hg -R modern debugupgraderepo --run
473 $ hg -R modern debugupgraderepo --run
474 upgrade will perform the following actions:
474 nothing to do
475
476 requirements
477 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
478
479 processed revlogs:
480 - all-filelogs
481 - changelog
482 - manifest
483
484 beginning upgrade...
485 repository locked and read-only
486 creating temporary repository to stage upgraded data: $TESTTMP/modern/.hg/upgrade.* (glob)
487 (it is safe to interrupt this process any time before data migration completes)
488 data fully upgraded in a temporary repository
489 marking source repository as being upgraded; clients will be unable to read from repository
490 starting in-place swap of repository data
491 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
492 replacing store...
493 store replacement complete; repository was inconsistent for *s (glob)
494 finalizing requirements file and making repository readable again
495 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
496 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
497 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
498
475
499 Upgrading a repository to generaldelta works
476 Upgrading a repository to generaldelta works
500
477
501 $ hg --config format.usegeneraldelta=false init upgradegd
478 $ hg --config format.usegeneraldelta=false init upgradegd
502 $ cd upgradegd
479 $ cd upgradegd
503 $ touch f0
480 $ touch f0
504 $ hg -q commit -A -m initial
481 $ hg -q commit -A -m initial
505 $ mkdir FooBarDirectory.d
482 $ mkdir FooBarDirectory.d
506 $ touch FooBarDirectory.d/f1
483 $ touch FooBarDirectory.d/f1
507 $ hg -q commit -A -m 'add f1'
484 $ hg -q commit -A -m 'add f1'
508 $ hg -q up -r 0
485 $ hg -q up -r 0
509 >>> from __future__ import absolute_import, print_function
486 >>> from __future__ import absolute_import, print_function
510 >>> import random
487 >>> import random
511 >>> random.seed(0) # have a reproducible content
488 >>> random.seed(0) # have a reproducible content
512 >>> with open("f2", "wb") as f:
489 >>> with open("f2", "wb") as f:
513 ... for i in range(100000):
490 ... for i in range(100000):
514 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
491 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
515 $ hg -q commit -A -m 'add f2'
492 $ hg -q commit -A -m 'add f2'
516
493
517 make sure we have a .d file
494 make sure we have a .d file
518
495
519 $ ls -d .hg/store/data/*
496 $ ls -d .hg/store/data/*
520 .hg/store/data/_foo_bar_directory.d.hg
497 .hg/store/data/_foo_bar_directory.d.hg
521 .hg/store/data/f0.i
498 .hg/store/data/f0.i
522 .hg/store/data/f2.d
499 .hg/store/data/f2.d
523 .hg/store/data/f2.i
500 .hg/store/data/f2.i
524
501
525 $ hg debugupgraderepo --run --config format.sparse-revlog=false
502 $ hg debugupgraderepo --run --config format.sparse-revlog=false
526 upgrade will perform the following actions:
503 upgrade will perform the following actions:
527
504
528 requirements
505 requirements
529 preserved: dotencode, fncache, revlogv1, store
506 preserved: dotencode, fncache, revlogv1, store
530 added: generaldelta
507 added: generaldelta
531
508
532 generaldelta
509 generaldelta
533 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
510 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
534
511
535 processed revlogs:
512 processed revlogs:
536 - all-filelogs
513 - all-filelogs
537 - changelog
514 - changelog
538 - manifest
515 - manifest
539
516
540 beginning upgrade...
517 beginning upgrade...
541 repository locked and read-only
518 repository locked and read-only
542 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
519 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
543 (it is safe to interrupt this process any time before data migration completes)
520 (it is safe to interrupt this process any time before data migration completes)
544 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
521 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
545 migrating 519 KB in store; 1.05 MB tracked data
522 migrating 519 KB in store; 1.05 MB tracked data
546 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
523 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
547 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
524 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
548 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
525 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
549 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
526 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
550 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
527 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
551 finished migrating 3 changelog revisions; change in size: 0 bytes
528 finished migrating 3 changelog revisions; change in size: 0 bytes
552 finished migrating 9 total revisions; total change in store size: -17 bytes
529 finished migrating 9 total revisions; total change in store size: -17 bytes
553 copying phaseroots
530 copying phaseroots
554 data fully upgraded in a temporary repository
531 data fully upgraded in a temporary repository
555 marking source repository as being upgraded; clients will be unable to read from repository
532 marking source repository as being upgraded; clients will be unable to read from repository
556 starting in-place swap of repository data
533 starting in-place swap of repository data
557 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
534 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
558 replacing store...
535 replacing store...
559 store replacement complete; repository was inconsistent for *s (glob)
536 store replacement complete; repository was inconsistent for *s (glob)
560 finalizing requirements file and making repository readable again
537 finalizing requirements file and making repository readable again
561 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
538 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
562 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
539 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
563 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
540 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
564
541
565 Original requirements backed up
542 Original requirements backed up
566
543
567 $ cat .hg/upgradebackup.*/requires
544 $ cat .hg/upgradebackup.*/requires
568 dotencode
545 dotencode
569 fncache
546 fncache
570 revlogv1
547 revlogv1
571 store
548 store
572
549
573 generaldelta added to original requirements files
550 generaldelta added to original requirements files
574
551
575 $ cat .hg/requires
552 $ cat .hg/requires
576 dotencode
553 dotencode
577 fncache
554 fncache
578 generaldelta
555 generaldelta
579 revlogv1
556 revlogv1
580 store
557 store
581
558
582 store directory has files we expect
559 store directory has files we expect
583
560
584 $ ls .hg/store
561 $ ls .hg/store
585 00changelog.i
562 00changelog.i
586 00manifest.i
563 00manifest.i
587 data
564 data
588 fncache
565 fncache
589 phaseroots
566 phaseroots
590 undo
567 undo
591 undo.backupfiles
568 undo.backupfiles
592 undo.phaseroots
569 undo.phaseroots
593
570
594 manifest should be generaldelta
571 manifest should be generaldelta
595
572
596 $ hg debugrevlog -m | grep flags
573 $ hg debugrevlog -m | grep flags
597 flags : inline, generaldelta
574 flags : inline, generaldelta
598
575
599 verify should be happy
576 verify should be happy
600
577
601 $ hg verify
578 $ hg verify
602 checking changesets
579 checking changesets
603 checking manifests
580 checking manifests
604 crosschecking files in changesets and manifests
581 crosschecking files in changesets and manifests
605 checking files
582 checking files
606 checked 3 changesets with 3 changes to 3 files
583 checked 3 changesets with 3 changes to 3 files
607
584
608 old store should be backed up
585 old store should be backed up
609
586
610 $ ls -d .hg/upgradebackup.*/
587 $ ls -d .hg/upgradebackup.*/
611 .hg/upgradebackup.*/ (glob)
588 .hg/upgradebackup.*/ (glob)
612 $ ls .hg/upgradebackup.*/store
589 $ ls .hg/upgradebackup.*/store
613 00changelog.i
590 00changelog.i
614 00manifest.i
591 00manifest.i
615 data
592 data
616 fncache
593 fncache
617 phaseroots
594 phaseroots
618 undo
595 undo
619 undo.backup.fncache
596 undo.backup.fncache
620 undo.backupfiles
597 undo.backupfiles
621 undo.phaseroots
598 undo.phaseroots
622
599
623 unless --no-backup is passed
600 unless --no-backup is passed
624
601
625 $ rm -rf .hg/upgradebackup.*/
602 $ rm -rf .hg/upgradebackup.*/
626 $ hg debugupgraderepo --run --no-backup
603 $ hg debugupgraderepo --run --no-backup
627 upgrade will perform the following actions:
604 upgrade will perform the following actions:
628
605
629 requirements
606 requirements
630 preserved: dotencode, fncache, generaldelta, revlogv1, store
607 preserved: dotencode, fncache, generaldelta, revlogv1, store
631 added: sparserevlog
608 added: sparserevlog
632
609
633 sparserevlog
610 sparserevlog
634 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
611 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
635
612
636 processed revlogs:
613 processed revlogs:
637 - all-filelogs
614 - all-filelogs
638 - changelog
615 - changelog
639 - manifest
616 - manifest
640
617
641 beginning upgrade...
618 beginning upgrade...
642 repository locked and read-only
619 repository locked and read-only
643 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
620 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
644 (it is safe to interrupt this process any time before data migration completes)
621 (it is safe to interrupt this process any time before data migration completes)
645 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
622 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
646 migrating 519 KB in store; 1.05 MB tracked data
623 migrating 519 KB in store; 1.05 MB tracked data
647 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
624 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
648 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
625 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
649 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
626 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
650 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
627 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
651 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
628 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
652 finished migrating 3 changelog revisions; change in size: 0 bytes
629 finished migrating 3 changelog revisions; change in size: 0 bytes
653 finished migrating 9 total revisions; total change in store size: 0 bytes
630 finished migrating 9 total revisions; total change in store size: 0 bytes
654 copying phaseroots
631 copying phaseroots
655 data fully upgraded in a temporary repository
632 data fully upgraded in a temporary repository
656 marking source repository as being upgraded; clients will be unable to read from repository
633 marking source repository as being upgraded; clients will be unable to read from repository
657 starting in-place swap of repository data
634 starting in-place swap of repository data
658 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
635 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
659 replacing store...
636 replacing store...
660 store replacement complete; repository was inconsistent for * (glob)
637 store replacement complete; repository was inconsistent for * (glob)
661 finalizing requirements file and making repository readable again
638 finalizing requirements file and making repository readable again
662 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
639 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
663 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
640 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
664 $ ls -1 .hg/ | grep upgradebackup
641 $ ls -1 .hg/ | grep upgradebackup
665 [1]
642 [1]
666
643
667 We can restrict optimization to some revlog:
644 We can restrict optimization to some revlog:
668
645
669 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
646 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
670 upgrade will perform the following actions:
647 upgrade will perform the following actions:
671
648
672 requirements
649 requirements
673 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
650 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
674
651
675 optimisations: re-delta-parent
652 optimisations: re-delta-parent
676
653
677 re-delta-parent
654 re-delta-parent
678 deltas within internal storage will choose a new base revision if needed
655 deltas within internal storage will choose a new base revision if needed
679
656
680 processed revlogs:
657 processed revlogs:
681 - manifest
658 - manifest
682
659
683 beginning upgrade...
660 beginning upgrade...
684 repository locked and read-only
661 repository locked and read-only
685 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
662 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
686 (it is safe to interrupt this process any time before data migration completes)
663 (it is safe to interrupt this process any time before data migration completes)
687 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
664 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
688 migrating 519 KB in store; 1.05 MB tracked data
665 migrating 519 KB in store; 1.05 MB tracked data
689 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
666 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
690 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
667 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
691 blindly copying data/f0.i containing 1 revisions
668 blindly copying data/f0.i containing 1 revisions
692 blindly copying data/f2.i containing 1 revisions
669 blindly copying data/f2.i containing 1 revisions
693 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
670 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
694 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
671 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
695 cloning 3 revisions from 00manifest.i
672 cloning 3 revisions from 00manifest.i
696 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
673 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
697 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
674 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
698 blindly copying 00changelog.i containing 3 revisions
675 blindly copying 00changelog.i containing 3 revisions
699 finished migrating 3 changelog revisions; change in size: 0 bytes
676 finished migrating 3 changelog revisions; change in size: 0 bytes
700 finished migrating 9 total revisions; total change in store size: 0 bytes
677 finished migrating 9 total revisions; total change in store size: 0 bytes
701 copying phaseroots
678 copying phaseroots
702 data fully upgraded in a temporary repository
679 data fully upgraded in a temporary repository
703 marking source repository as being upgraded; clients will be unable to read from repository
680 marking source repository as being upgraded; clients will be unable to read from repository
704 starting in-place swap of repository data
681 starting in-place swap of repository data
705 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
682 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
706 replacing store...
683 replacing store...
707 store replacement complete; repository was inconsistent for *s (glob)
684 store replacement complete; repository was inconsistent for *s (glob)
708 finalizing requirements file and making repository readable again
685 finalizing requirements file and making repository readable again
709 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
686 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
710 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
687 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
711
688
712 Check that the repo still works fine
689 Check that the repo still works fine
713
690
714 $ hg log -G --stat
691 $ hg log -G --stat
715 @ changeset: 2:76d4395f5413 (no-py3 !)
692 @ changeset: 2:76d4395f5413 (no-py3 !)
716 @ changeset: 2:fca376863211 (py3 !)
693 @ changeset: 2:fca376863211 (py3 !)
717 | tag: tip
694 | tag: tip
718 | parent: 0:ba592bf28da2
695 | parent: 0:ba592bf28da2
719 | user: test
696 | user: test
720 | date: Thu Jan 01 00:00:00 1970 +0000
697 | date: Thu Jan 01 00:00:00 1970 +0000
721 | summary: add f2
698 | summary: add f2
722 |
699 |
723 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
700 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
724 | 1 files changed, 100000 insertions(+), 0 deletions(-)
701 | 1 files changed, 100000 insertions(+), 0 deletions(-)
725 |
702 |
726 | o changeset: 1:2029ce2354e2
703 | o changeset: 1:2029ce2354e2
727 |/ user: test
704 |/ user: test
728 | date: Thu Jan 01 00:00:00 1970 +0000
705 | date: Thu Jan 01 00:00:00 1970 +0000
729 | summary: add f1
706 | summary: add f1
730 |
707 |
731 |
708 |
732 o changeset: 0:ba592bf28da2
709 o changeset: 0:ba592bf28da2
733 user: test
710 user: test
734 date: Thu Jan 01 00:00:00 1970 +0000
711 date: Thu Jan 01 00:00:00 1970 +0000
735 summary: initial
712 summary: initial
736
713
737
714
738
715
739 $ hg verify
716 $ hg verify
740 checking changesets
717 checking changesets
741 checking manifests
718 checking manifests
742 crosschecking files in changesets and manifests
719 crosschecking files in changesets and manifests
743 checking files
720 checking files
744 checked 3 changesets with 3 changes to 3 files
721 checked 3 changesets with 3 changes to 3 files
745
722
746 Check we can select negatively
723 Check we can select negatively
747
724
748 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
725 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
749 upgrade will perform the following actions:
726 upgrade will perform the following actions:
750
727
751 requirements
728 requirements
752 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
729 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
753
730
754 optimisations: re-delta-parent
731 optimisations: re-delta-parent
755
732
756 re-delta-parent
733 re-delta-parent
757 deltas within internal storage will choose a new base revision if needed
734 deltas within internal storage will choose a new base revision if needed
758
735
759 processed revlogs:
736 processed revlogs:
760 - all-filelogs
737 - all-filelogs
761 - changelog
738 - changelog
762
739
763 beginning upgrade...
740 beginning upgrade...
764 repository locked and read-only
741 repository locked and read-only
765 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
742 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
766 (it is safe to interrupt this process any time before data migration completes)
743 (it is safe to interrupt this process any time before data migration completes)
767 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
744 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
768 migrating 519 KB in store; 1.05 MB tracked data
745 migrating 519 KB in store; 1.05 MB tracked data
769 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
746 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
770 cloning 1 revisions from data/FooBarDirectory.d/f1.i
747 cloning 1 revisions from data/FooBarDirectory.d/f1.i
771 cloning 1 revisions from data/f0.i
748 cloning 1 revisions from data/f0.i
772 cloning 1 revisions from data/f2.i
749 cloning 1 revisions from data/f2.i
773 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
750 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
774 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
751 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
775 blindly copying 00manifest.i containing 3 revisions
752 blindly copying 00manifest.i containing 3 revisions
776 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
753 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
777 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
754 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
778 cloning 3 revisions from 00changelog.i
755 cloning 3 revisions from 00changelog.i
779 finished migrating 3 changelog revisions; change in size: 0 bytes
756 finished migrating 3 changelog revisions; change in size: 0 bytes
780 finished migrating 9 total revisions; total change in store size: 0 bytes
757 finished migrating 9 total revisions; total change in store size: 0 bytes
781 copying phaseroots
758 copying phaseroots
782 data fully upgraded in a temporary repository
759 data fully upgraded in a temporary repository
783 marking source repository as being upgraded; clients will be unable to read from repository
760 marking source repository as being upgraded; clients will be unable to read from repository
784 starting in-place swap of repository data
761 starting in-place swap of repository data
785 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
762 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
786 replacing store...
763 replacing store...
787 store replacement complete; repository was inconsistent for *s (glob)
764 store replacement complete; repository was inconsistent for *s (glob)
788 finalizing requirements file and making repository readable again
765 finalizing requirements file and making repository readable again
789 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
766 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
790 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
767 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
791 $ hg verify
768 $ hg verify
792 checking changesets
769 checking changesets
793 checking manifests
770 checking manifests
794 crosschecking files in changesets and manifests
771 crosschecking files in changesets and manifests
795 checking files
772 checking files
796 checked 3 changesets with 3 changes to 3 files
773 checked 3 changesets with 3 changes to 3 files
797
774
798 Check that we can select changelog only
775 Check that we can select changelog only
799
776
800 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
777 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
801 upgrade will perform the following actions:
778 upgrade will perform the following actions:
802
779
803 requirements
780 requirements
804 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
781 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
805
782
806 optimisations: re-delta-parent
783 optimisations: re-delta-parent
807
784
808 re-delta-parent
785 re-delta-parent
809 deltas within internal storage will choose a new base revision if needed
786 deltas within internal storage will choose a new base revision if needed
810
787
811 processed revlogs:
788 processed revlogs:
812 - changelog
789 - changelog
813
790
814 beginning upgrade...
791 beginning upgrade...
815 repository locked and read-only
792 repository locked and read-only
816 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
793 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
817 (it is safe to interrupt this process any time before data migration completes)
794 (it is safe to interrupt this process any time before data migration completes)
818 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
795 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
819 migrating 519 KB in store; 1.05 MB tracked data
796 migrating 519 KB in store; 1.05 MB tracked data
820 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
797 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
821 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
798 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
822 blindly copying data/f0.i containing 1 revisions
799 blindly copying data/f0.i containing 1 revisions
823 blindly copying data/f2.i containing 1 revisions
800 blindly copying data/f2.i containing 1 revisions
824 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
801 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
825 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
802 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
826 blindly copying 00manifest.i containing 3 revisions
803 blindly copying 00manifest.i containing 3 revisions
827 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
804 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
828 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
805 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
829 cloning 3 revisions from 00changelog.i
806 cloning 3 revisions from 00changelog.i
830 finished migrating 3 changelog revisions; change in size: 0 bytes
807 finished migrating 3 changelog revisions; change in size: 0 bytes
831 finished migrating 9 total revisions; total change in store size: 0 bytes
808 finished migrating 9 total revisions; total change in store size: 0 bytes
832 copying phaseroots
809 copying phaseroots
833 data fully upgraded in a temporary repository
810 data fully upgraded in a temporary repository
834 marking source repository as being upgraded; clients will be unable to read from repository
811 marking source repository as being upgraded; clients will be unable to read from repository
835 starting in-place swap of repository data
812 starting in-place swap of repository data
836 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
813 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
837 replacing store...
814 replacing store...
838 store replacement complete; repository was inconsistent for *s (glob)
815 store replacement complete; repository was inconsistent for *s (glob)
839 finalizing requirements file and making repository readable again
816 finalizing requirements file and making repository readable again
840 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
817 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
841 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
818 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
842 $ hg verify
819 $ hg verify
843 checking changesets
820 checking changesets
844 checking manifests
821 checking manifests
845 crosschecking files in changesets and manifests
822 crosschecking files in changesets and manifests
846 checking files
823 checking files
847 checked 3 changesets with 3 changes to 3 files
824 checked 3 changesets with 3 changes to 3 files
848
825
849 Check that we can select filelog only
826 Check that we can select filelog only
850
827
851 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
828 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
852 upgrade will perform the following actions:
829 upgrade will perform the following actions:
853
830
854 requirements
831 requirements
855 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
832 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
856
833
857 optimisations: re-delta-parent
834 optimisations: re-delta-parent
858
835
859 re-delta-parent
836 re-delta-parent
860 deltas within internal storage will choose a new base revision if needed
837 deltas within internal storage will choose a new base revision if needed
861
838
862 processed revlogs:
839 processed revlogs:
863 - all-filelogs
840 - all-filelogs
864
841
865 beginning upgrade...
842 beginning upgrade...
866 repository locked and read-only
843 repository locked and read-only
867 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
844 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
868 (it is safe to interrupt this process any time before data migration completes)
845 (it is safe to interrupt this process any time before data migration completes)
869 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
846 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
870 migrating 519 KB in store; 1.05 MB tracked data
847 migrating 519 KB in store; 1.05 MB tracked data
871 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
848 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
872 cloning 1 revisions from data/FooBarDirectory.d/f1.i
849 cloning 1 revisions from data/FooBarDirectory.d/f1.i
873 cloning 1 revisions from data/f0.i
850 cloning 1 revisions from data/f0.i
874 cloning 1 revisions from data/f2.i
851 cloning 1 revisions from data/f2.i
875 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
852 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
876 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
853 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
877 blindly copying 00manifest.i containing 3 revisions
854 blindly copying 00manifest.i containing 3 revisions
878 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
855 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
879 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
856 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
880 blindly copying 00changelog.i containing 3 revisions
857 blindly copying 00changelog.i containing 3 revisions
881 finished migrating 3 changelog revisions; change in size: 0 bytes
858 finished migrating 3 changelog revisions; change in size: 0 bytes
882 finished migrating 9 total revisions; total change in store size: 0 bytes
859 finished migrating 9 total revisions; total change in store size: 0 bytes
883 copying phaseroots
860 copying phaseroots
884 data fully upgraded in a temporary repository
861 data fully upgraded in a temporary repository
885 marking source repository as being upgraded; clients will be unable to read from repository
862 marking source repository as being upgraded; clients will be unable to read from repository
886 starting in-place swap of repository data
863 starting in-place swap of repository data
887 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
864 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
888 replacing store...
865 replacing store...
889 store replacement complete; repository was inconsistent for *s (glob)
866 store replacement complete; repository was inconsistent for *s (glob)
890 finalizing requirements file and making repository readable again
867 finalizing requirements file and making repository readable again
891 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
868 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
892 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
869 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
893 $ hg verify
870 $ hg verify
894 checking changesets
871 checking changesets
895 checking manifests
872 checking manifests
896 crosschecking files in changesets and manifests
873 crosschecking files in changesets and manifests
897 checking files
874 checking files
898 checked 3 changesets with 3 changes to 3 files
875 checked 3 changesets with 3 changes to 3 files
899
876
900
877
901 Check you can't skip revlog clone during important format downgrade
878 Check you can't skip revlog clone during important format downgrade
902
879
903 $ echo "[format]" > .hg/hgrc
880 $ echo "[format]" > .hg/hgrc
904 $ echo "sparse-revlog=no" >> .hg/hgrc
881 $ echo "sparse-revlog=no" >> .hg/hgrc
905 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
882 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
906 ignoring revlogs selection flags, format requirements change: sparserevlog
883 ignoring revlogs selection flags, format requirements change: sparserevlog
907 upgrade will perform the following actions:
884 upgrade will perform the following actions:
908
885
909 requirements
886 requirements
910 preserved: dotencode, fncache, generaldelta, revlogv1, store
887 preserved: dotencode, fncache, generaldelta, revlogv1, store
911 removed: sparserevlog
888 removed: sparserevlog
912
889
913 optimisations: re-delta-parent
890 optimisations: re-delta-parent
914
891
915 re-delta-parent
892 re-delta-parent
916 deltas within internal storage will choose a new base revision if needed
893 deltas within internal storage will choose a new base revision if needed
917
894
918 processed revlogs:
895 processed revlogs:
919 - all-filelogs
896 - all-filelogs
920 - changelog
897 - changelog
921 - manifest
898 - manifest
922
899
923 beginning upgrade...
900 beginning upgrade...
924 repository locked and read-only
901 repository locked and read-only
925 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
902 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
926 (it is safe to interrupt this process any time before data migration completes)
903 (it is safe to interrupt this process any time before data migration completes)
927 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
904 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
928 migrating 519 KB in store; 1.05 MB tracked data
905 migrating 519 KB in store; 1.05 MB tracked data
929 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
906 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
930 cloning 1 revisions from data/FooBarDirectory.d/f1.i
907 cloning 1 revisions from data/FooBarDirectory.d/f1.i
931 cloning 1 revisions from data/f0.i
908 cloning 1 revisions from data/f0.i
932 cloning 1 revisions from data/f2.i
909 cloning 1 revisions from data/f2.i
933 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
910 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
934 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
911 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
935 cloning 3 revisions from 00manifest.i
912 cloning 3 revisions from 00manifest.i
936 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
913 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
937 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
914 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
938 cloning 3 revisions from 00changelog.i
915 cloning 3 revisions from 00changelog.i
939 finished migrating 3 changelog revisions; change in size: 0 bytes
916 finished migrating 3 changelog revisions; change in size: 0 bytes
940 finished migrating 9 total revisions; total change in store size: 0 bytes
917 finished migrating 9 total revisions; total change in store size: 0 bytes
941 copying phaseroots
918 copying phaseroots
942 data fully upgraded in a temporary repository
919 data fully upgraded in a temporary repository
943 marking source repository as being upgraded; clients will be unable to read from repository
920 marking source repository as being upgraded; clients will be unable to read from repository
944 starting in-place swap of repository data
921 starting in-place swap of repository data
945 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
922 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
946 replacing store...
923 replacing store...
947 store replacement complete; repository was inconsistent for *s (glob)
924 store replacement complete; repository was inconsistent for *s (glob)
948 finalizing requirements file and making repository readable again
925 finalizing requirements file and making repository readable again
949 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
926 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
950 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
927 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
951 $ hg verify
928 $ hg verify
952 checking changesets
929 checking changesets
953 checking manifests
930 checking manifests
954 crosschecking files in changesets and manifests
931 crosschecking files in changesets and manifests
955 checking files
932 checking files
956 checked 3 changesets with 3 changes to 3 files
933 checked 3 changesets with 3 changes to 3 files
957
934
958 Check you can't skip revlog clone during important format upgrade
935 Check you can't skip revlog clone during important format upgrade
959
936
960 $ echo "sparse-revlog=yes" >> .hg/hgrc
937 $ echo "sparse-revlog=yes" >> .hg/hgrc
961 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
938 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
962 ignoring revlogs selection flags, format requirements change: sparserevlog
939 ignoring revlogs selection flags, format requirements change: sparserevlog
963 upgrade will perform the following actions:
940 upgrade will perform the following actions:
964
941
965 requirements
942 requirements
966 preserved: dotencode, fncache, generaldelta, revlogv1, store
943 preserved: dotencode, fncache, generaldelta, revlogv1, store
967 added: sparserevlog
944 added: sparserevlog
968
945
969 optimisations: re-delta-parent
946 optimisations: re-delta-parent
970
947
971 sparserevlog
948 sparserevlog
972 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
949 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
973
950
974 re-delta-parent
951 re-delta-parent
975 deltas within internal storage will choose a new base revision if needed
952 deltas within internal storage will choose a new base revision if needed
976
953
977 processed revlogs:
954 processed revlogs:
978 - all-filelogs
955 - all-filelogs
979 - changelog
956 - changelog
980 - manifest
957 - manifest
981
958
982 beginning upgrade...
959 beginning upgrade...
983 repository locked and read-only
960 repository locked and read-only
984 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
961 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
985 (it is safe to interrupt this process any time before data migration completes)
962 (it is safe to interrupt this process any time before data migration completes)
986 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
963 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
987 migrating 519 KB in store; 1.05 MB tracked data
964 migrating 519 KB in store; 1.05 MB tracked data
988 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
965 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
989 cloning 1 revisions from data/FooBarDirectory.d/f1.i
966 cloning 1 revisions from data/FooBarDirectory.d/f1.i
990 cloning 1 revisions from data/f0.i
967 cloning 1 revisions from data/f0.i
991 cloning 1 revisions from data/f2.i
968 cloning 1 revisions from data/f2.i
992 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
969 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
993 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
970 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
994 cloning 3 revisions from 00manifest.i
971 cloning 3 revisions from 00manifest.i
995 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
972 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
996 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
973 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
997 cloning 3 revisions from 00changelog.i
974 cloning 3 revisions from 00changelog.i
998 finished migrating 3 changelog revisions; change in size: 0 bytes
975 finished migrating 3 changelog revisions; change in size: 0 bytes
999 finished migrating 9 total revisions; total change in store size: 0 bytes
976 finished migrating 9 total revisions; total change in store size: 0 bytes
1000 copying phaseroots
977 copying phaseroots
1001 data fully upgraded in a temporary repository
978 data fully upgraded in a temporary repository
1002 marking source repository as being upgraded; clients will be unable to read from repository
979 marking source repository as being upgraded; clients will be unable to read from repository
1003 starting in-place swap of repository data
980 starting in-place swap of repository data
1004 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
981 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1005 replacing store...
982 replacing store...
1006 store replacement complete; repository was inconsistent for *s (glob)
983 store replacement complete; repository was inconsistent for *s (glob)
1007 finalizing requirements file and making repository readable again
984 finalizing requirements file and making repository readable again
1008 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
985 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1009 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
986 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1010 $ hg verify
987 $ hg verify
1011 checking changesets
988 checking changesets
1012 checking manifests
989 checking manifests
1013 crosschecking files in changesets and manifests
990 crosschecking files in changesets and manifests
1014 checking files
991 checking files
1015 checked 3 changesets with 3 changes to 3 files
992 checked 3 changesets with 3 changes to 3 files
1016
993
1017 $ cd ..
994 $ cd ..
1018
995
1019 store files with special filenames aren't encoded during copy
996 store files with special filenames aren't encoded during copy
1020
997
1021 $ hg init store-filenames
998 $ hg init store-filenames
1022 $ cd store-filenames
999 $ cd store-filenames
1023 $ touch foo
1000 $ touch foo
1024 $ hg -q commit -A -m initial
1001 $ hg -q commit -A -m initial
1025 $ touch .hg/store/.XX_special_filename
1002 $ touch .hg/store/.XX_special_filename
1026
1003
1027 $ hg debugupgraderepo --run
1004 $ hg debugupgraderepo --run
1028 upgrade will perform the following actions:
1005 nothing to do
1029
1030 requirements
1031 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1032
1033 processed revlogs:
1034 - all-filelogs
1035 - changelog
1036 - manifest
1037
1038 beginning upgrade...
1039 repository locked and read-only
1040 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1041 (it is safe to interrupt this process any time before data migration completes)
1042 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1043 migrating 301 bytes in store; 107 bytes tracked data
1044 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1045 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1046 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1047 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1048 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1049 finished migrating 1 changelog revisions; change in size: 0 bytes
1050 finished migrating 3 total revisions; total change in store size: 0 bytes
1051 copying .XX_special_filename
1052 copying phaseroots
1053 data fully upgraded in a temporary repository
1054 marking source repository as being upgraded; clients will be unable to read from repository
1055 starting in-place swap of repository data
1056 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1057 replacing store...
1058 store replacement complete; repository was inconsistent for *s (glob)
1059 finalizing requirements file and making repository readable again
1060 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1061 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1062 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1063 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1006 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1064 upgrade will perform the following actions:
1007 upgrade will perform the following actions:
1065
1008
1066 requirements
1009 requirements
1067 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1010 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1068
1011
1069 optimisations: re-delta-fulladd
1012 optimisations: re-delta-fulladd
1070
1013
1071 re-delta-fulladd
1014 re-delta-fulladd
1072 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1015 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1073
1016
1074 processed revlogs:
1017 processed revlogs:
1075 - all-filelogs
1018 - all-filelogs
1076 - changelog
1019 - changelog
1077 - manifest
1020 - manifest
1078
1021
1079 beginning upgrade...
1022 beginning upgrade...
1080 repository locked and read-only
1023 repository locked and read-only
1081 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1024 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1082 (it is safe to interrupt this process any time before data migration completes)
1025 (it is safe to interrupt this process any time before data migration completes)
1083 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1026 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1084 migrating 301 bytes in store; 107 bytes tracked data
1027 migrating 301 bytes in store; 107 bytes tracked data
1085 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1028 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1086 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1029 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1087 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1030 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1088 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1031 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1089 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1032 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1090 finished migrating 1 changelog revisions; change in size: 0 bytes
1033 finished migrating 1 changelog revisions; change in size: 0 bytes
1091 finished migrating 3 total revisions; total change in store size: 0 bytes
1034 finished migrating 3 total revisions; total change in store size: 0 bytes
1092 copying .XX_special_filename
1035 copying .XX_special_filename
1093 copying phaseroots
1036 copying phaseroots
1094 data fully upgraded in a temporary repository
1037 data fully upgraded in a temporary repository
1095 marking source repository as being upgraded; clients will be unable to read from repository
1038 marking source repository as being upgraded; clients will be unable to read from repository
1096 starting in-place swap of repository data
1039 starting in-place swap of repository data
1097 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1040 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1098 replacing store...
1041 replacing store...
1099 store replacement complete; repository was inconsistent for *s (glob)
1042 store replacement complete; repository was inconsistent for *s (glob)
1100 finalizing requirements file and making repository readable again
1043 finalizing requirements file and making repository readable again
1101 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1044 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1102 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1045 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1103 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1046 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1104
1047
1105 fncache is valid after upgrade
1048 fncache is valid after upgrade
1106
1049
1107 $ hg debugrebuildfncache
1050 $ hg debugrebuildfncache
1108 fncache already up to date
1051 fncache already up to date
1109
1052
1110 $ cd ..
1053 $ cd ..
1111
1054
1112 Check upgrading a large file repository
1055 Check upgrading a large file repository
1113 ---------------------------------------
1056 ---------------------------------------
1114
1057
1115 $ hg init largefilesrepo
1058 $ hg init largefilesrepo
1116 $ cat << EOF >> largefilesrepo/.hg/hgrc
1059 $ cat << EOF >> largefilesrepo/.hg/hgrc
1117 > [extensions]
1060 > [extensions]
1118 > largefiles =
1061 > largefiles =
1119 > EOF
1062 > EOF
1120
1063
1121 $ cd largefilesrepo
1064 $ cd largefilesrepo
1122 $ touch foo
1065 $ touch foo
1123 $ hg add --large foo
1066 $ hg add --large foo
1124 $ hg -q commit -m initial
1067 $ hg -q commit -m initial
1125 $ cat .hg/requires
1068 $ cat .hg/requires
1126 dotencode
1069 dotencode
1127 fncache
1070 fncache
1128 generaldelta
1071 generaldelta
1129 largefiles
1072 largefiles
1130 revlogv1
1073 revlogv1
1131 sparserevlog
1074 sparserevlog
1132 store
1075 store
1133
1076
1134 $ hg debugupgraderepo --run
1077 $ hg debugupgraderepo --run
1135 upgrade will perform the following actions:
1078 nothing to do
1136
1137 requirements
1138 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1139
1140 processed revlogs:
1141 - all-filelogs
1142 - changelog
1143 - manifest
1144
1145 beginning upgrade...
1146 repository locked and read-only
1147 creating temporary repository to stage upgraded data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1148 (it is safe to interrupt this process any time before data migration completes)
1149 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1150 migrating 355 bytes in store; 160 bytes tracked data
1151 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1152 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1153 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1154 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1155 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1156 finished migrating 1 changelog revisions; change in size: 0 bytes
1157 finished migrating 3 total revisions; total change in store size: 0 bytes
1158 copying phaseroots
1159 data fully upgraded in a temporary repository
1160 marking source repository as being upgraded; clients will be unable to read from repository
1161 starting in-place swap of repository data
1162 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1163 replacing store...
1164 store replacement complete; repository was inconsistent for *s (glob)
1165 finalizing requirements file and making repository readable again
1166 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1167 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1168 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1169 $ cat .hg/requires
1079 $ cat .hg/requires
1170 dotencode
1080 dotencode
1171 fncache
1081 fncache
1172 generaldelta
1082 generaldelta
1173 largefiles
1083 largefiles
1174 revlogv1
1084 revlogv1
1175 sparserevlog
1085 sparserevlog
1176 store
1086 store
1177
1087
1178 $ cat << EOF >> .hg/hgrc
1088 $ cat << EOF >> .hg/hgrc
1179 > [extensions]
1089 > [extensions]
1180 > lfs =
1090 > lfs =
1181 > [lfs]
1091 > [lfs]
1182 > threshold = 10
1092 > threshold = 10
1183 > EOF
1093 > EOF
1184 $ echo '123456789012345' > lfs.bin
1094 $ echo '123456789012345' > lfs.bin
1185 $ hg ci -Am 'lfs.bin'
1095 $ hg ci -Am 'lfs.bin'
1186 adding lfs.bin
1096 adding lfs.bin
1187 $ grep lfs .hg/requires
1097 $ grep lfs .hg/requires
1188 lfs
1098 lfs
1189 $ find .hg/store/lfs -type f
1099 $ find .hg/store/lfs -type f
1190 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1100 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1191
1101
1192 $ hg debugupgraderepo --run
1102 $ hg debugupgraderepo --run
1193 upgrade will perform the following actions:
1103 nothing to do
1194
1195 requirements
1196 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1197
1198 processed revlogs:
1199 - all-filelogs
1200 - changelog
1201 - manifest
1202
1203 beginning upgrade...
1204 repository locked and read-only
1205 creating temporary repository to stage upgraded data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1206 (it is safe to interrupt this process any time before data migration completes)
1207 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1208 migrating 801 bytes in store; 467 bytes tracked data
1209 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1210 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1211 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1212 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1213 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1214 finished migrating 2 changelog revisions; change in size: 0 bytes
1215 finished migrating 6 total revisions; total change in store size: 0 bytes
1216 copying phaseroots
1217 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1218 data fully upgraded in a temporary repository
1219 marking source repository as being upgraded; clients will be unable to read from repository
1220 starting in-place swap of repository data
1221 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1222 replacing store...
1223 store replacement complete; repository was inconsistent for *s (glob)
1224 finalizing requirements file and making repository readable again
1225 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1226 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1227 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1228
1104
1229 $ grep lfs .hg/requires
1105 $ grep lfs .hg/requires
1230 lfs
1106 lfs
1231 $ find .hg/store/lfs -type f
1107 $ find .hg/store/lfs -type f
1232 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1108 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1233 $ hg verify
1109 $ hg verify
1234 checking changesets
1110 checking changesets
1235 checking manifests
1111 checking manifests
1236 crosschecking files in changesets and manifests
1112 crosschecking files in changesets and manifests
1237 checking files
1113 checking files
1238 checked 2 changesets with 2 changes to 2 files
1114 checked 2 changesets with 2 changes to 2 files
1239 $ hg debugdata lfs.bin 0
1115 $ hg debugdata lfs.bin 0
1240 version https://git-lfs.github.com/spec/v1
1116 version https://git-lfs.github.com/spec/v1
1241 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1117 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1242 size 16
1118 size 16
1243 x-is-binary 0
1119 x-is-binary 0
1244
1120
1245 $ cd ..
1121 $ cd ..
1246
1122
1247 repository config is taken in account
1123 repository config is taken in account
1248 -------------------------------------
1124 -------------------------------------
1249
1125
1250 $ cat << EOF >> $HGRCPATH
1126 $ cat << EOF >> $HGRCPATH
1251 > [format]
1127 > [format]
1252 > maxchainlen = 1
1128 > maxchainlen = 1
1253 > EOF
1129 > EOF
1254
1130
1255 $ hg init localconfig
1131 $ hg init localconfig
1256 $ cd localconfig
1132 $ cd localconfig
1257 $ cat << EOF > file
1133 $ cat << EOF > file
1258 > some content
1134 > some content
1259 > with some length
1135 > with some length
1260 > to make sure we get a delta
1136 > to make sure we get a delta
1261 > after changes
1137 > after changes
1262 > very long
1138 > very long
1263 > very long
1139 > very long
1264 > very long
1140 > very long
1265 > very long
1141 > very long
1266 > very long
1142 > very long
1267 > very long
1143 > very long
1268 > very long
1144 > very long
1269 > very long
1145 > very long
1270 > very long
1146 > very long
1271 > very long
1147 > very long
1272 > very long
1148 > very long
1273 > EOF
1149 > EOF
1274 $ hg -q commit -A -m A
1150 $ hg -q commit -A -m A
1275 $ echo "new line" >> file
1151 $ echo "new line" >> file
1276 $ hg -q commit -m B
1152 $ hg -q commit -m B
1277 $ echo "new line" >> file
1153 $ echo "new line" >> file
1278 $ hg -q commit -m C
1154 $ hg -q commit -m C
1279
1155
1280 $ cat << EOF >> .hg/hgrc
1156 $ cat << EOF >> .hg/hgrc
1281 > [format]
1157 > [format]
1282 > maxchainlen = 9001
1158 > maxchainlen = 9001
1283 > EOF
1159 > EOF
1284 $ hg config format
1160 $ hg config format
1285 format.maxchainlen=9001
1161 format.maxchainlen=9001
1286 $ hg debugdeltachain file
1162 $ hg debugdeltachain file
1287 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1163 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1288 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1164 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1289 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1165 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1290 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1166 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1291
1167
1292 $ hg debugupgraderepo --run --optimize 're-delta-all'
1168 $ hg debugupgraderepo --run --optimize 're-delta-all'
1293 upgrade will perform the following actions:
1169 upgrade will perform the following actions:
1294
1170
1295 requirements
1171 requirements
1296 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1172 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1297
1173
1298 optimisations: re-delta-all
1174 optimisations: re-delta-all
1299
1175
1300 re-delta-all
1176 re-delta-all
1301 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1177 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1302
1178
1303 processed revlogs:
1179 processed revlogs:
1304 - all-filelogs
1180 - all-filelogs
1305 - changelog
1181 - changelog
1306 - manifest
1182 - manifest
1307
1183
1308 beginning upgrade...
1184 beginning upgrade...
1309 repository locked and read-only
1185 repository locked and read-only
1310 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1186 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1311 (it is safe to interrupt this process any time before data migration completes)
1187 (it is safe to interrupt this process any time before data migration completes)
1312 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1188 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1313 migrating 1019 bytes in store; 882 bytes tracked data
1189 migrating 1019 bytes in store; 882 bytes tracked data
1314 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1190 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1315 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1191 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1316 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1192 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1317 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1193 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1318 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1194 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1319 finished migrating 3 changelog revisions; change in size: 0 bytes
1195 finished migrating 3 changelog revisions; change in size: 0 bytes
1320 finished migrating 9 total revisions; total change in store size: -9 bytes
1196 finished migrating 9 total revisions; total change in store size: -9 bytes
1321 copying phaseroots
1197 copying phaseroots
1322 data fully upgraded in a temporary repository
1198 data fully upgraded in a temporary repository
1323 marking source repository as being upgraded; clients will be unable to read from repository
1199 marking source repository as being upgraded; clients will be unable to read from repository
1324 starting in-place swap of repository data
1200 starting in-place swap of repository data
1325 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1201 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1326 replacing store...
1202 replacing store...
1327 store replacement complete; repository was inconsistent for *s (glob)
1203 store replacement complete; repository was inconsistent for *s (glob)
1328 finalizing requirements file and making repository readable again
1204 finalizing requirements file and making repository readable again
1329 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1205 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1330 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1206 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1331 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1207 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1332 $ hg debugdeltachain file
1208 $ hg debugdeltachain file
1333 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1209 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1334 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1210 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1335 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1211 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1336 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1212 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1337 $ cd ..
1213 $ cd ..
1338
1214
1339 $ cat << EOF >> $HGRCPATH
1215 $ cat << EOF >> $HGRCPATH
1340 > [format]
1216 > [format]
1341 > maxchainlen = 9001
1217 > maxchainlen = 9001
1342 > EOF
1218 > EOF
1343
1219
1344 Check upgrading a sparse-revlog repository
1220 Check upgrading a sparse-revlog repository
1345 ---------------------------------------
1221 ---------------------------------------
1346
1222
1347 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1223 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1348 $ cd sparserevlogrepo
1224 $ cd sparserevlogrepo
1349 $ touch foo
1225 $ touch foo
1350 $ hg add foo
1226 $ hg add foo
1351 $ hg -q commit -m "foo"
1227 $ hg -q commit -m "foo"
1352 $ cat .hg/requires
1228 $ cat .hg/requires
1353 dotencode
1229 dotencode
1354 fncache
1230 fncache
1355 generaldelta
1231 generaldelta
1356 revlogv1
1232 revlogv1
1357 store
1233 store
1358
1234
1359 Check that we can add the sparse-revlog format requirement
1235 Check that we can add the sparse-revlog format requirement
1360 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1236 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1361 upgrade will perform the following actions:
1237 upgrade will perform the following actions:
1362
1238
1363 requirements
1239 requirements
1364 preserved: dotencode, fncache, generaldelta, revlogv1, store
1240 preserved: dotencode, fncache, generaldelta, revlogv1, store
1365 added: sparserevlog
1241 added: sparserevlog
1366
1242
1367 processed revlogs:
1243 processed revlogs:
1368 - all-filelogs
1244 - all-filelogs
1369 - changelog
1245 - changelog
1370 - manifest
1246 - manifest
1371
1247
1372 $ cat .hg/requires
1248 $ cat .hg/requires
1373 dotencode
1249 dotencode
1374 fncache
1250 fncache
1375 generaldelta
1251 generaldelta
1376 revlogv1
1252 revlogv1
1377 sparserevlog
1253 sparserevlog
1378 store
1254 store
1379
1255
1380 Check that we can remove the sparse-revlog format requirement
1256 Check that we can remove the sparse-revlog format requirement
1381 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1257 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1382 upgrade will perform the following actions:
1258 upgrade will perform the following actions:
1383
1259
1384 requirements
1260 requirements
1385 preserved: dotencode, fncache, generaldelta, revlogv1, store
1261 preserved: dotencode, fncache, generaldelta, revlogv1, store
1386 removed: sparserevlog
1262 removed: sparserevlog
1387
1263
1388 processed revlogs:
1264 processed revlogs:
1389 - all-filelogs
1265 - all-filelogs
1390 - changelog
1266 - changelog
1391 - manifest
1267 - manifest
1392
1268
1393 $ cat .hg/requires
1269 $ cat .hg/requires
1394 dotencode
1270 dotencode
1395 fncache
1271 fncache
1396 generaldelta
1272 generaldelta
1397 revlogv1
1273 revlogv1
1398 store
1274 store
1399
1275
1400 #if zstd
1276 #if zstd
1401
1277
1402 Check upgrading to a zstd revlog
1278 Check upgrading to a zstd revlog
1403 --------------------------------
1279 --------------------------------
1404
1280
1405 upgrade
1281 upgrade
1406
1282
1407 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1283 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1408 upgrade will perform the following actions:
1284 upgrade will perform the following actions:
1409
1285
1410 requirements
1286 requirements
1411 preserved: dotencode, fncache, generaldelta, revlogv1, store
1287 preserved: dotencode, fncache, generaldelta, revlogv1, store
1412 added: revlog-compression-zstd, sparserevlog
1288 added: revlog-compression-zstd, sparserevlog
1413
1289
1414 processed revlogs:
1290 processed revlogs:
1415 - all-filelogs
1291 - all-filelogs
1416 - changelog
1292 - changelog
1417 - manifest
1293 - manifest
1418
1294
1419 $ hg debugformat -v
1295 $ hg debugformat -v
1420 format-variant repo config default
1296 format-variant repo config default
1421 fncache: yes yes yes
1297 fncache: yes yes yes
1422 dotencode: yes yes yes
1298 dotencode: yes yes yes
1423 generaldelta: yes yes yes
1299 generaldelta: yes yes yes
1424 exp-sharesafe: no no no
1300 exp-sharesafe: no no no
1425 sparserevlog: yes yes yes
1301 sparserevlog: yes yes yes
1426 sidedata: no no no
1302 sidedata: no no no
1427 persistent-nodemap: no no no
1303 persistent-nodemap: no no no
1428 copies-sdc: no no no
1304 copies-sdc: no no no
1429 plain-cl-delta: yes yes yes
1305 plain-cl-delta: yes yes yes
1430 compression: zstd zlib zlib
1306 compression: zstd zlib zlib
1431 compression-level: default default default
1307 compression-level: default default default
1432 $ cat .hg/requires
1308 $ cat .hg/requires
1433 dotencode
1309 dotencode
1434 fncache
1310 fncache
1435 generaldelta
1311 generaldelta
1436 revlog-compression-zstd
1312 revlog-compression-zstd
1437 revlogv1
1313 revlogv1
1438 sparserevlog
1314 sparserevlog
1439 store
1315 store
1440
1316
1441 downgrade
1317 downgrade
1442
1318
1443 $ hg debugupgraderepo --run --no-backup --quiet
1319 $ hg debugupgraderepo --run --no-backup --quiet
1444 upgrade will perform the following actions:
1320 upgrade will perform the following actions:
1445
1321
1446 requirements
1322 requirements
1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1323 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1448 removed: revlog-compression-zstd
1324 removed: revlog-compression-zstd
1449
1325
1450 processed revlogs:
1326 processed revlogs:
1451 - all-filelogs
1327 - all-filelogs
1452 - changelog
1328 - changelog
1453 - manifest
1329 - manifest
1454
1330
1455 $ hg debugformat -v
1331 $ hg debugformat -v
1456 format-variant repo config default
1332 format-variant repo config default
1457 fncache: yes yes yes
1333 fncache: yes yes yes
1458 dotencode: yes yes yes
1334 dotencode: yes yes yes
1459 generaldelta: yes yes yes
1335 generaldelta: yes yes yes
1460 exp-sharesafe: no no no
1336 exp-sharesafe: no no no
1461 sparserevlog: yes yes yes
1337 sparserevlog: yes yes yes
1462 sidedata: no no no
1338 sidedata: no no no
1463 persistent-nodemap: no no no
1339 persistent-nodemap: no no no
1464 copies-sdc: no no no
1340 copies-sdc: no no no
1465 plain-cl-delta: yes yes yes
1341 plain-cl-delta: yes yes yes
1466 compression: zlib zlib zlib
1342 compression: zlib zlib zlib
1467 compression-level: default default default
1343 compression-level: default default default
1468 $ cat .hg/requires
1344 $ cat .hg/requires
1469 dotencode
1345 dotencode
1470 fncache
1346 fncache
1471 generaldelta
1347 generaldelta
1472 revlogv1
1348 revlogv1
1473 sparserevlog
1349 sparserevlog
1474 store
1350 store
1475
1351
1476 upgrade from hgrc
1352 upgrade from hgrc
1477
1353
1478 $ cat >> .hg/hgrc << EOF
1354 $ cat >> .hg/hgrc << EOF
1479 > [format]
1355 > [format]
1480 > revlog-compression=zstd
1356 > revlog-compression=zstd
1481 > EOF
1357 > EOF
1482 $ hg debugupgraderepo --run --no-backup --quiet
1358 $ hg debugupgraderepo --run --no-backup --quiet
1483 upgrade will perform the following actions:
1359 upgrade will perform the following actions:
1484
1360
1485 requirements
1361 requirements
1486 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1362 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1487 added: revlog-compression-zstd
1363 added: revlog-compression-zstd
1488
1364
1489 processed revlogs:
1365 processed revlogs:
1490 - all-filelogs
1366 - all-filelogs
1491 - changelog
1367 - changelog
1492 - manifest
1368 - manifest
1493
1369
1494 $ hg debugformat -v
1370 $ hg debugformat -v
1495 format-variant repo config default
1371 format-variant repo config default
1496 fncache: yes yes yes
1372 fncache: yes yes yes
1497 dotencode: yes yes yes
1373 dotencode: yes yes yes
1498 generaldelta: yes yes yes
1374 generaldelta: yes yes yes
1499 exp-sharesafe: no no no
1375 exp-sharesafe: no no no
1500 sparserevlog: yes yes yes
1376 sparserevlog: yes yes yes
1501 sidedata: no no no
1377 sidedata: no no no
1502 persistent-nodemap: no no no
1378 persistent-nodemap: no no no
1503 copies-sdc: no no no
1379 copies-sdc: no no no
1504 plain-cl-delta: yes yes yes
1380 plain-cl-delta: yes yes yes
1505 compression: zstd zstd zlib
1381 compression: zstd zstd zlib
1506 compression-level: default default default
1382 compression-level: default default default
1507 $ cat .hg/requires
1383 $ cat .hg/requires
1508 dotencode
1384 dotencode
1509 fncache
1385 fncache
1510 generaldelta
1386 generaldelta
1511 revlog-compression-zstd
1387 revlog-compression-zstd
1512 revlogv1
1388 revlogv1
1513 sparserevlog
1389 sparserevlog
1514 store
1390 store
1515
1391
1516 #endif
1392 #endif
1517
1393
1518 Check upgrading to a side-data revlog
1394 Check upgrading to a side-data revlog
1519 -------------------------------------
1395 -------------------------------------
1520
1396
1521 upgrade
1397 upgrade
1522
1398
1523 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1399 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1524 upgrade will perform the following actions:
1400 upgrade will perform the following actions:
1525
1401
1526 requirements
1402 requirements
1527 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1403 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1528 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1404 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1529 added: exp-sidedata-flag (zstd !)
1405 added: exp-sidedata-flag (zstd !)
1530 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1406 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1531
1407
1532 processed revlogs:
1408 processed revlogs:
1533 - all-filelogs
1409 - all-filelogs
1534 - changelog
1410 - changelog
1535 - manifest
1411 - manifest
1536
1412
1537 $ hg debugformat -v
1413 $ hg debugformat -v
1538 format-variant repo config default
1414 format-variant repo config default
1539 fncache: yes yes yes
1415 fncache: yes yes yes
1540 dotencode: yes yes yes
1416 dotencode: yes yes yes
1541 generaldelta: yes yes yes
1417 generaldelta: yes yes yes
1542 exp-sharesafe: no no no
1418 exp-sharesafe: no no no
1543 sparserevlog: yes yes yes
1419 sparserevlog: yes yes yes
1544 sidedata: yes no no
1420 sidedata: yes no no
1545 persistent-nodemap: no no no
1421 persistent-nodemap: no no no
1546 copies-sdc: no no no
1422 copies-sdc: no no no
1547 plain-cl-delta: yes yes yes
1423 plain-cl-delta: yes yes yes
1548 compression: zlib zlib zlib (no-zstd !)
1424 compression: zlib zlib zlib (no-zstd !)
1549 compression: zstd zstd zlib (zstd !)
1425 compression: zstd zstd zlib (zstd !)
1550 compression-level: default default default
1426 compression-level: default default default
1551 $ cat .hg/requires
1427 $ cat .hg/requires
1552 dotencode
1428 dotencode
1553 exp-sidedata-flag
1429 exp-sidedata-flag
1554 fncache
1430 fncache
1555 generaldelta
1431 generaldelta
1556 revlog-compression-zstd (zstd !)
1432 revlog-compression-zstd (zstd !)
1557 revlogv1
1433 revlogv1
1558 sparserevlog
1434 sparserevlog
1559 store
1435 store
1560 $ hg debugsidedata -c 0
1436 $ hg debugsidedata -c 0
1561 2 sidedata entries
1437 2 sidedata entries
1562 entry-0001 size 4
1438 entry-0001 size 4
1563 entry-0002 size 32
1439 entry-0002 size 32
1564
1440
1565 downgrade
1441 downgrade
1566
1442
1567 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1443 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1568 upgrade will perform the following actions:
1444 upgrade will perform the following actions:
1569
1445
1570 requirements
1446 requirements
1571 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1572 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1448 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1573 removed: exp-sidedata-flag
1449 removed: exp-sidedata-flag
1574
1450
1575 processed revlogs:
1451 processed revlogs:
1576 - all-filelogs
1452 - all-filelogs
1577 - changelog
1453 - changelog
1578 - manifest
1454 - manifest
1579
1455
1580 $ hg debugformat -v
1456 $ hg debugformat -v
1581 format-variant repo config default
1457 format-variant repo config default
1582 fncache: yes yes yes
1458 fncache: yes yes yes
1583 dotencode: yes yes yes
1459 dotencode: yes yes yes
1584 generaldelta: yes yes yes
1460 generaldelta: yes yes yes
1585 exp-sharesafe: no no no
1461 exp-sharesafe: no no no
1586 sparserevlog: yes yes yes
1462 sparserevlog: yes yes yes
1587 sidedata: no no no
1463 sidedata: no no no
1588 persistent-nodemap: no no no
1464 persistent-nodemap: no no no
1589 copies-sdc: no no no
1465 copies-sdc: no no no
1590 plain-cl-delta: yes yes yes
1466 plain-cl-delta: yes yes yes
1591 compression: zlib zlib zlib (no-zstd !)
1467 compression: zlib zlib zlib (no-zstd !)
1592 compression: zstd zstd zlib (zstd !)
1468 compression: zstd zstd zlib (zstd !)
1593 compression-level: default default default
1469 compression-level: default default default
1594 $ cat .hg/requires
1470 $ cat .hg/requires
1595 dotencode
1471 dotencode
1596 fncache
1472 fncache
1597 generaldelta
1473 generaldelta
1598 revlog-compression-zstd (zstd !)
1474 revlog-compression-zstd (zstd !)
1599 revlogv1
1475 revlogv1
1600 sparserevlog
1476 sparserevlog
1601 store
1477 store
1602 $ hg debugsidedata -c 0
1478 $ hg debugsidedata -c 0
1603
1479
1604 upgrade from hgrc
1480 upgrade from hgrc
1605
1481
1606 $ cat >> .hg/hgrc << EOF
1482 $ cat >> .hg/hgrc << EOF
1607 > [format]
1483 > [format]
1608 > exp-use-side-data=yes
1484 > exp-use-side-data=yes
1609 > EOF
1485 > EOF
1610 $ hg debugupgraderepo --run --no-backup --quiet
1486 $ hg debugupgraderepo --run --no-backup --quiet
1611 upgrade will perform the following actions:
1487 upgrade will perform the following actions:
1612
1488
1613 requirements
1489 requirements
1614 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1490 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1615 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1491 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1616 added: exp-sidedata-flag
1492 added: exp-sidedata-flag
1617
1493
1618 processed revlogs:
1494 processed revlogs:
1619 - all-filelogs
1495 - all-filelogs
1620 - changelog
1496 - changelog
1621 - manifest
1497 - manifest
1622
1498
1623 $ hg debugformat -v
1499 $ hg debugformat -v
1624 format-variant repo config default
1500 format-variant repo config default
1625 fncache: yes yes yes
1501 fncache: yes yes yes
1626 dotencode: yes yes yes
1502 dotencode: yes yes yes
1627 generaldelta: yes yes yes
1503 generaldelta: yes yes yes
1628 exp-sharesafe: no no no
1504 exp-sharesafe: no no no
1629 sparserevlog: yes yes yes
1505 sparserevlog: yes yes yes
1630 sidedata: yes yes no
1506 sidedata: yes yes no
1631 persistent-nodemap: no no no
1507 persistent-nodemap: no no no
1632 copies-sdc: no no no
1508 copies-sdc: no no no
1633 plain-cl-delta: yes yes yes
1509 plain-cl-delta: yes yes yes
1634 compression: zlib zlib zlib (no-zstd !)
1510 compression: zlib zlib zlib (no-zstd !)
1635 compression: zstd zstd zlib (zstd !)
1511 compression: zstd zstd zlib (zstd !)
1636 compression-level: default default default
1512 compression-level: default default default
1637 $ cat .hg/requires
1513 $ cat .hg/requires
1638 dotencode
1514 dotencode
1639 exp-sidedata-flag
1515 exp-sidedata-flag
1640 fncache
1516 fncache
1641 generaldelta
1517 generaldelta
1642 revlog-compression-zstd (zstd !)
1518 revlog-compression-zstd (zstd !)
1643 revlogv1
1519 revlogv1
1644 sparserevlog
1520 sparserevlog
1645 store
1521 store
1646 $ hg debugsidedata -c 0
1522 $ hg debugsidedata -c 0
1647
1523
1648 Demonstrate that nothing to perform upgrade will still run all the way through
1524 Demonstrate that nothing to perform upgrade will still run all the way through
1649 FIXME: this should return early
1650
1525
1651 $ hg debugupgraderepo --run
1526 $ hg debugupgraderepo --run
1652 upgrade will perform the following actions:
1527 nothing to do
1653
1654 requirements
1655 preserved: dotencode, exp-sidedata-flag, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store
1656
1657 processed revlogs:
1658 - all-filelogs
1659 - changelog
1660 - manifest
1661
1662 beginning upgrade...
1663 repository locked and read-only
1664 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1665 (it is safe to interrupt this process any time before data migration completes)
1666 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1667 migrating 297 bytes in store; 103 bytes tracked data
1668 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1669 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1670 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1671 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1672 migrating changelog containing 1 revisions (123 bytes in store; 58 bytes tracked data)
1673 finished migrating 1 changelog revisions; change in size: 0 bytes
1674 finished migrating 3 total revisions; total change in store size: 0 bytes
1675 copying phaseroots
1676 data fully upgraded in a temporary repository
1677 marking source repository as being upgraded; clients will be unable to read from repository
1678 starting in-place swap of repository data
1679 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1680 replacing store...
1681 store replacement complete; repository was inconsistent for *s (glob)
1682 finalizing requirements file and making repository readable again
1683 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1684 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1685 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
General Comments 0
You need to be logged in to leave comments. Login now