Mercurial > hg-stable
changeset 3708:1debe70db9d7
Make mq use changegroup.writebundle for writing strip backups.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 22 Nov 2006 23:07:15 +0100 |
parents | 67f44b825784 |
children | 38291d9c8c1c |
files | hgext/mq.py |
diffstat | 1 files changed, 2 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Wed Nov 22 23:02:28 2006 +0100 +++ b/hgext/mq.py Wed Nov 22 23:07:15 2006 +0100 @@ -33,7 +33,7 @@ from mercurial.i18n import gettext as _ from mercurial import commands demandload(globals(), "os sys re struct traceback errno bz2") -demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,util") +demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,util,changegroup") commands.norepo += " qclone qversion" @@ -612,22 +612,7 @@ name = os.path.join(backupdir, "%s" % revlog.short(rev)) name = savename(name) self.ui.warn("saving bundle to %s\n" % name) - # TODO, exclusive open - f = open(name, "wb") - try: - f.write("HG10") - z = bz2.BZ2Compressor(9) - while 1: - chunk = cg.read(4096) - if not chunk: - break - f.write(z.compress(chunk)) - f.write(z.flush()) - except: - os.unlink(name) - raise - f.close() - return name + return changegroup.writebundle(cg, name, "HG10BZ") def stripall(rev, revnum): cl = repo.changelog