##// END OF EJS Templates
commands: teach debugbundle to print bundle specification...
Gregory Szorc -
r27885:2370c661 default
parent child Browse files
Show More
@@ -2007,12 +2007,18 b' def debugbuilddag(ui, repo, text=None,'
2007 release(tr, lock)
2007 release(tr, lock)
2008
2008
2009 @command('debugbundle',
2009 @command('debugbundle',
2010 [('a', 'all', None, _('show all details'))],
2010 [('a', 'all', None, _('show all details')),
2011 ('', 'spec', None, _('print the bundlespec of the bundle'))],
2011 _('FILE'),
2012 _('FILE'),
2012 norepo=True)
2013 norepo=True)
2013 def debugbundle(ui, bundlepath, all=None, **opts):
2014 def debugbundle(ui, bundlepath, all=None, spec=None, **opts):
2014 """lists the contents of a bundle"""
2015 """lists the contents of a bundle"""
2015 with hg.openpath(ui, bundlepath) as f:
2016 with hg.openpath(ui, bundlepath) as f:
2017 if spec:
2018 spec = exchange.getbundlespec(ui, f)
2019 ui.write('%s\n' % spec)
2020 return
2021
2016 gen = exchange.readbundle(ui, f, bundlepath)
2022 gen = exchange.readbundle(ui, f, bundlepath)
2017 if isinstance(gen, bundle2.unbundle20):
2023 if isinstance(gen, bundle2.unbundle20):
2018 return _debugbundle2(ui, gen, all=all, **opts)
2024 return _debugbundle2(ui, gen, all=all, **opts)
@@ -43,6 +43,7 b' test bundle types'
43 > f -q -B6 -D ../b$t; echo
43 > f -q -B6 -D ../b$t; echo
44 > cd ../t$t
44 > cd ../t$t
45 > hg debugbundle ../b$t
45 > hg debugbundle ../b$t
46 > hg debugbundle --spec ../b$t
46 > echo
47 > echo
47 > cd ..
48 > cd ..
48 > done
49 > done
@@ -53,6 +54,7 b' test bundle types'
53 Stream params: {}
54 Stream params: {}
54 changegroup -- "{'version': '02'}"
55 changegroup -- "{'version': '02'}"
55 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
56 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
57 none-v2
56
58
57 % test bundle type bzip2
59 % test bundle type bzip2
58 searching for changes
60 searching for changes
@@ -61,6 +63,7 b' test bundle types'
61 Stream params: {'Compression': 'BZ'}
63 Stream params: {'Compression': 'BZ'}
62 changegroup -- "{'version': '02'}"
64 changegroup -- "{'version': '02'}"
63 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
65 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
66 bzip2-v2
64
67
65 % test bundle type gzip
68 % test bundle type gzip
66 searching for changes
69 searching for changes
@@ -69,6 +72,7 b' test bundle types'
69 Stream params: {'Compression': 'GZ'}
72 Stream params: {'Compression': 'GZ'}
70 changegroup -- "{'version': '02'}"
73 changegroup -- "{'version': '02'}"
71 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
74 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
75 gzip-v2
72
76
73 % test bundle type none-v2
77 % test bundle type none-v2
74 searching for changes
78 searching for changes
@@ -77,6 +81,7 b' test bundle types'
77 Stream params: {}
81 Stream params: {}
78 changegroup -- "{'version': '02'}"
82 changegroup -- "{'version': '02'}"
79 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
83 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
84 none-v2
80
85
81 % test bundle type v2
86 % test bundle type v2
82 searching for changes
87 searching for changes
@@ -85,18 +90,21 b' test bundle types'
85 Stream params: {'Compression': 'BZ'}
90 Stream params: {'Compression': 'BZ'}
86 changegroup -- "{'version': '02'}"
91 changegroup -- "{'version': '02'}"
87 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
92 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
93 bzip2-v2
88
94
89 % test bundle type v1
95 % test bundle type v1
90 searching for changes
96 searching for changes
91 1 changesets found
97 1 changesets found
92 HG10BZ
98 HG10BZ
93 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
99 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
100 bzip2-v1
94
101
95 % test bundle type gzip-v1
102 % test bundle type gzip-v1
96 searching for changes
103 searching for changes
97 1 changesets found
104 1 changesets found
98 HG10GZ
105 HG10GZ
99 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
106 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
107 gzip-v1
100
108
101
109
102 test garbage file
110 test garbage file
@@ -276,6 +276,9 b' packed1 is produced properly'
276 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
276 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
277 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil|
277 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil|
278
278
279 $ hg debugbundle --spec packed.hg
280 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1
281
279 generaldelta requirement is listed in stream clone bundles
282 generaldelta requirement is listed in stream clone bundles
280
283
281 $ hg --config format.generaldelta=true init testgd
284 $ hg --config format.generaldelta=true init testgd
@@ -294,6 +297,9 b' generaldelta requirement is listed in st'
294 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
297 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
295 0030: 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 03 00 01 |ta/foo.i.64.....|
298 0030: 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 03 00 01 |ta/foo.i.64.....|
296
299
300 $ hg debugbundle --spec packedgd.hg
301 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1
302
297 Unpacking packed1 bundles with "hg unbundle" isn't allowed
303 Unpacking packed1 bundles with "hg unbundle" isn't allowed
298
304
299 $ hg init packed
305 $ hg init packed
@@ -236,7 +236,7 b' Show all commands + options'
236 debugancestor:
236 debugancestor:
237 debugapplystreamclonebundle:
237 debugapplystreamclonebundle:
238 debugbuilddag: mergeable-file, overwritten-file, new-file
238 debugbuilddag: mergeable-file, overwritten-file, new-file
239 debugbundle: all
239 debugbundle: all, spec
240 debugcheckstate:
240 debugcheckstate:
241 debugcommands:
241 debugcommands:
242 debugcomplete: options
242 debugcomplete: options
General Comments 0
You need to be logged in to leave comments. Login now