comparison mercurial/commands.py @ 3669:f4dc02d7fb71

unduplicate bundle writing code from httprepo
author Matt Mackall <mpm@selenic.com>
date Wed, 15 Nov 2006 23:37:45 -0600
parents 8500a13ec44b
children b4903debbe3b
comparison
equal deleted inserted replaced
3668:e99ba8726bda 3669:f4dc02d7fb71
330 330
331 if revs: 331 if revs:
332 cg = repo.changegroupsubset(o, revs, 'bundle') 332 cg = repo.changegroupsubset(o, revs, 'bundle')
333 else: 333 else:
334 cg = repo.changegroup(o, 'bundle') 334 cg = repo.changegroup(o, 'bundle')
335 changegroup.writebundle(cg, fname, False) 335 changegroup.writebundle(cg, fname, "HG10")
336 336
337 def cat(ui, repo, file1, *pats, **opts): 337 def cat(ui, repo, file1, *pats, **opts):
338 """output the latest or given revisions of files 338 """output the latest or given revisions of files
339 339
340 Print the specified files as they were at the given revision. 340 Print the specified files as they were at the given revision.
1290 try: 1290 try:
1291 fname = opts["bundle"] 1291 fname = opts["bundle"]
1292 if fname or not other.local(): 1292 if fname or not other.local():
1293 # create a bundle (uncompressed if other repo is not local) 1293 # create a bundle (uncompressed if other repo is not local)
1294 cg = other.changegroup(incoming, "incoming") 1294 cg = other.changegroup(incoming, "incoming")
1295 fname = cleanup = changegroup.writebundle(cg, fname, other.local()) 1295 type = other.local() and "HG10" or "HG10UN"
1296 fname = cleanup = changegroup.writebundle(cg, fname, type)
1296 # keep written bundle? 1297 # keep written bundle?
1297 if opts["bundle"]: 1298 if opts["bundle"]:
1298 cleanup = None 1299 cleanup = None
1299 if not other.local(): 1300 if not other.local():
1300 # use the created uncompressed bundlerepo 1301 # use the created uncompressed bundlerepo