equal
deleted
inserted
replaced
21 import dagparser, context, simplemerge, graphmod, copies |
21 import dagparser, context, simplemerge, graphmod, copies |
22 import random, operator |
22 import random, operator |
23 import setdiscovery, treediscovery, dagutil, pvec, localrepo, destutil |
23 import setdiscovery, treediscovery, dagutil, pvec, localrepo, destutil |
24 import phases, obsolete, exchange, bundle2, repair, lock as lockmod |
24 import phases, obsolete, exchange, bundle2, repair, lock as lockmod |
25 import ui as uimod |
25 import ui as uimod |
|
26 import streamclone |
26 |
27 |
27 table = {} |
28 table = {} |
28 |
29 |
29 command = cmdutil.command(table) |
30 command = cmdutil.command(table) |
30 |
31 |
1248 except error.UnsupportedBundleSpecification as e: |
1249 except error.UnsupportedBundleSpecification as e: |
1249 raise error.Abort(str(e), |
1250 raise error.Abort(str(e), |
1250 hint=_('see "hg help bundle" for supported ' |
1251 hint=_('see "hg help bundle" for supported ' |
1251 'values for --type')) |
1252 'values for --type')) |
1252 |
1253 |
|
1254 # Packed bundles are a pseudo bundle format for now. |
|
1255 if cgversion == 's1': |
|
1256 raise error.Abort(_('packed bundles cannot be produced by "hg bundle"'), |
|
1257 hint=_('use "hg debugcreatestreamclonebundle"')) |
|
1258 |
1253 if opts.get('all'): |
1259 if opts.get('all'): |
1254 base = ['null'] |
1260 base = ['null'] |
1255 else: |
1261 else: |
1256 base = scmutil.revrange(repo, opts.get('base')) |
1262 base = scmutil.revrange(repo, opts.get('base')) |
1257 # TODO: get desired bundlecaps from command line. |
1263 # TODO: get desired bundlecaps from command line. |
1957 if not chunkdata: |
1963 if not chunkdata: |
1958 break |
1964 break |
1959 node = chunkdata['node'] |
1965 node = chunkdata['node'] |
1960 ui.write(" %s\n" % hex(node)) |
1966 ui.write(" %s\n" % hex(node)) |
1961 chain = node |
1967 chain = node |
|
1968 |
|
1969 @command('debugcreatestreamclonebundle', [], 'FILE') |
|
1970 def debugcreatestreamclonebundle(ui, repo, fname): |
|
1971 """create a stream clone bundle file |
|
1972 |
|
1973 Stream bundles are special bundles that are essentially archives of |
|
1974 revlog files. They are commonly used for cloning very quickly. |
|
1975 """ |
|
1976 requirements, gen = streamclone.generatebundlev1(repo) |
|
1977 changegroup.writechunks(ui, gen, fname) |
|
1978 |
|
1979 ui.write(_('bundle requirements: %s\n') % ', '.join(sorted(requirements))) |
1962 |
1980 |
1963 @command('debugcheckstate', [], '') |
1981 @command('debugcheckstate', [], '') |
1964 def debugcheckstate(ui, repo): |
1982 def debugcheckstate(ui, repo): |
1965 """validate the correctness of the current dirstate""" |
1983 """validate the correctness of the current dirstate""" |
1966 parent1, parent2 = repo.dirstate.parents() |
1984 parent1, parent2 = repo.dirstate.parents() |