[PATCH STABLE] unbundle: cleanly abort on unknown bundle2 feature
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Sep 25 20:46:17 UTC 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1443213049 25200
# Fri Sep 25 13:30:49 2015 -0700
# Branch stable
# Node ID 0b61757d647d473e8339be449b20cccd0084df3c
# Parent 0dda3692ec9b6b9e220ad7afa1434b553f8f62c0
unbundle: cleanly abort on unknown bundle2 feature
The exception wasn't caught and resulted in a traceback.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6370,10 +6370,16 @@ def unbundle(ui, repo, fname1, *fnames,
if isinstance(gen, bundle2.unbundle20):
tr = repo.transaction('unbundle')
try:
op = bundle2.processbundle(repo, gen, lambda: tr)
tr.close()
+ except error.UnsupportedPartError as exc:
+ raise util.Abort(_('%s: unknown bundle feature, %s')
+ % (fname, exc),
+ hint=_("see https://mercurial.selenic.com/"
+ "wiki/BundleFeature for more "
+ "information"))
finally:
if tr:
tr.release()
changes = [r.get('result', 0)
for r in op.records['changegroup']]
More information about the Mercurial-devel
mailing list