mercurial/commands.py
changeset 26758 bde7ef23340d
parent 26757 43708f92f471
child 26759 c0f475ac997e
--- a/mercurial/commands.py	Sat Oct 17 11:40:29 2015 -0700
+++ b/mercurial/commands.py	Thu Oct 15 13:43:18 2015 -0700
@@ -1978,6 +1978,13 @@
 
     ui.write(_('bundle requirements: %s\n') % ', '.join(sorted(requirements)))
 
+@command('debugapplystreamclonebundle', [], 'FILE')
+def debugapplystreamclonebundle(ui, repo, fname):
+    """apply a stream clone bundle file"""
+    f = hg.openpath(ui, fname)
+    gen = exchange.readbundle(ui, f, fname)
+    gen.apply(repo)
+
 @command('debugcheckstate', [], '')
 def debugcheckstate(ui, repo):
     """validate the correctness of the current dirstate"""
@@ -6532,6 +6539,11 @@
                 changes = [r.get('return', 0)
                            for r in op.records['changegroup']]
                 modheads = changegroup.combineresults(changes)
+            elif isinstance(gen, streamclone.streamcloneapplier):
+                raise error.Abort(
+                        _('packed bundles cannot be applied with '
+                          '"hg unbundle"'),
+                        hint=_('use "hg debugapplystreamclonebundle"'))
             else:
                 modheads = gen.apply(repo, 'unbundle', 'bundle:' + fname)
     finally: