Mercurial > hg
changeset 26799:ae03d4190321
shelve: properly process bundle2 bundle
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 19 Oct 2015 15:42:50 +0200 |
parents | 38dcb85f9370 |
children | 7cac6ee41be7 |
files | hgext/shelve.py |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/shelve.py Tue Oct 20 03:07:23 2015 +0200 +++ b/hgext/shelve.py Mon Oct 19 15:42:50 2015 +0200 @@ -27,7 +27,7 @@ from mercurial.node import nullid, nullrev, bin, hex from mercurial import changegroup, cmdutil, scmutil, phases, commands from mercurial import error, hg, mdiff, merge, patch, repair, util -from mercurial import templatefilters, exchange, bundlerepo +from mercurial import templatefilters, exchange, bundlerepo, bundle2 from mercurial import lock as lockmod from hgext import rebase import errno @@ -96,9 +96,15 @@ fp = self.opener() try: gen = exchange.readbundle(self.repo.ui, fp, self.fname, self.vfs) - gen.apply(self.repo, 'unshelve', - 'bundle:' + self.vfs.join(self.fname), - targetphase=phases.secret) + if not isinstance(gen, bundle2.unbundle20): + gen.apply(self.repo, 'unshelve', + 'bundle:' + self.vfs.join(self.fname), + targetphase=phases.secret) + if isinstance(gen, bundle2.unbundle20): + bundle2.applybundle(self.repo, gen, + self.repo.currenttransaction(), + source='unshelve', + url='bundle:' + self.vfs.join(self.fname)) finally: fp.close()