Show More
@@ -33,7 +33,7 b' from mercurial.demandload import *' | |||||
33 | from mercurial.i18n import gettext as _ |
|
33 | from mercurial.i18n import gettext as _ | |
34 | from mercurial import commands |
|
34 | from mercurial import commands | |
35 | demandload(globals(), "os sys re struct traceback errno bz2") |
|
35 | demandload(globals(), "os sys re struct traceback errno bz2") | |
36 | demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,util") |
|
36 | demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,util,changegroup") | |
37 |
|
37 | |||
38 | commands.norepo += " qclone qversion" |
|
38 | commands.norepo += " qclone qversion" | |
39 |
|
39 | |||
@@ -612,22 +612,7 b' class queue:' | |||||
612 | name = os.path.join(backupdir, "%s" % revlog.short(rev)) |
|
612 | name = os.path.join(backupdir, "%s" % revlog.short(rev)) | |
613 | name = savename(name) |
|
613 | name = savename(name) | |
614 | self.ui.warn("saving bundle to %s\n" % name) |
|
614 | self.ui.warn("saving bundle to %s\n" % name) | |
615 | # TODO, exclusive open |
|
615 | return changegroup.writebundle(cg, name, "HG10BZ") | |
616 | f = open(name, "wb") |
|
|||
617 | try: |
|
|||
618 | f.write("HG10") |
|
|||
619 | z = bz2.BZ2Compressor(9) |
|
|||
620 | while 1: |
|
|||
621 | chunk = cg.read(4096) |
|
|||
622 | if not chunk: |
|
|||
623 | break |
|
|||
624 | f.write(z.compress(chunk)) |
|
|||
625 | f.write(z.flush()) |
|
|||
626 | except: |
|
|||
627 | os.unlink(name) |
|
|||
628 | raise |
|
|||
629 | f.close() |
|
|||
630 | return name |
|
|||
631 |
|
616 | |||
632 | def stripall(rev, revnum): |
|
617 | def stripall(rev, revnum): | |
633 | cl = repo.changelog |
|
618 | cl = repo.changelog |
General Comments 0
You need to be logged in to leave comments.
Login now