Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 13747:cede00420e1e
code indentation fixes
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 23 Mar 2011 23:33:14 +0100 |
parents | b51bf961b3cb |
children | 85d74f6babf6 |
comparison
equal
deleted
inserted
replaced
13746:d80b768545cb | 13747:cede00420e1e |
---|---|
1232 | 1232 |
1233 def debugbundle(ui, bundlepath, all=None, **opts): | 1233 def debugbundle(ui, bundlepath, all=None, **opts): |
1234 """lists the contents of a bundle""" | 1234 """lists the contents of a bundle""" |
1235 f = url.open(ui, bundlepath) | 1235 f = url.open(ui, bundlepath) |
1236 try: | 1236 try: |
1237 gen = changegroup.readbundle(f, bundlepath) | 1237 gen = changegroup.readbundle(f, bundlepath) |
1238 if all: | 1238 if all: |
1239 ui.write("format: id, p1, p2, cset, len(delta)\n") | 1239 ui.write("format: id, p1, p2, cset, len(delta)\n") |
1240 | 1240 |
1241 def showchunks(named): | 1241 def showchunks(named): |
1242 ui.write("\n%s\n" % named) | 1242 ui.write("\n%s\n" % named) |
1243 while 1: | |
1244 chunkdata = gen.parsechunk() | |
1245 if not chunkdata: | |
1246 break | |
1247 node = chunkdata['node'] | |
1248 p1 = chunkdata['p1'] | |
1249 p2 = chunkdata['p2'] | |
1250 cs = chunkdata['cs'] | |
1251 delta = chunkdata['data'] | |
1252 ui.write("%s %s %s %s %s\n" % | |
1253 (hex(node), hex(p1), hex(p2), | |
1254 hex(cs), len(delta))) | |
1255 | |
1256 showchunks("changelog") | |
1257 showchunks("manifest") | |
1258 while 1: | |
1259 fname = gen.chunk() | |
1260 if not fname: | |
1261 break | |
1262 showchunks(fname) | |
1263 else: | |
1264 while 1: | 1243 while 1: |
1265 chunkdata = gen.parsechunk() | 1244 chunkdata = gen.parsechunk() |
1266 if not chunkdata: | 1245 if not chunkdata: |
1267 break | 1246 break |
1268 node = chunkdata['node'] | 1247 node = chunkdata['node'] |
1269 ui.write("%s\n" % hex(node)) | 1248 p1 = chunkdata['p1'] |
1249 p2 = chunkdata['p2'] | |
1250 cs = chunkdata['cs'] | |
1251 delta = chunkdata['data'] | |
1252 ui.write("%s %s %s %s %s\n" % | |
1253 (hex(node), hex(p1), hex(p2), | |
1254 hex(cs), len(delta))) | |
1255 | |
1256 showchunks("changelog") | |
1257 showchunks("manifest") | |
1258 while 1: | |
1259 fname = gen.chunk() | |
1260 if not fname: | |
1261 break | |
1262 showchunks(fname) | |
1263 else: | |
1264 while 1: | |
1265 chunkdata = gen.parsechunk() | |
1266 if not chunkdata: | |
1267 break | |
1268 node = chunkdata['node'] | |
1269 ui.write("%s\n" % hex(node)) | |
1270 finally: | 1270 finally: |
1271 f.close() | 1271 f.close() |
1272 | 1272 |
1273 def debuggetbundle(ui, repopath, bundlepath, head=None, common=None, **opts): | 1273 def debuggetbundle(ui, repopath, bundlepath, head=None, common=None, **opts): |
1274 """retrieves a bundle from a repo | 1274 """retrieves a bundle from a repo |