mercurial/commands.py
changeset 32882 0d98b11b8467
parent 32844 76bb53f8d374
child 32928 ac9867519103
--- a/mercurial/commands.py	Fri Jun 16 10:36:43 2017 -0700
+++ b/mercurial/commands.py	Fri Jun 16 10:38:14 2017 -0700
@@ -5316,6 +5316,11 @@
         for fname in fnames:
             f = hg.openpath(ui, fname)
             gen = exchange.readbundle(ui, f, fname)
+            if isinstance(gen, streamclone.streamcloneapplier):
+                raise error.Abort(
+                        _('packed bundles cannot be applied with '
+                          '"hg unbundle"'),
+                        hint=_('use "hg debugapplystreamclonebundle"'))
             if isinstance(gen, bundle2.unbundle20):
                 with repo.transaction('unbundle') as tr:
                     try:
@@ -5331,11 +5336,6 @@
                 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)