Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 26367:f31ddc9bfa5f stable
unbundle: cleanly abort on unknown bundle2 feature
The exception wasn't caught and resulted in a traceback.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 25 Sep 2015 13:30:49 -0700 |
parents | 6fbe35588433 |
children | 0224d22ef5d8 |
comparison
equal
deleted
inserted
replaced
26151:0dda3692ec9b | 26367:f31ddc9bfa5f |
---|---|
6370 if isinstance(gen, bundle2.unbundle20): | 6370 if isinstance(gen, bundle2.unbundle20): |
6371 tr = repo.transaction('unbundle') | 6371 tr = repo.transaction('unbundle') |
6372 try: | 6372 try: |
6373 op = bundle2.processbundle(repo, gen, lambda: tr) | 6373 op = bundle2.processbundle(repo, gen, lambda: tr) |
6374 tr.close() | 6374 tr.close() |
6375 except error.UnsupportedPartError as exc: | |
6376 raise util.Abort(_('%s: unknown bundle feature, %s') | |
6377 % (fname, exc), | |
6378 hint=_("see https://mercurial.selenic.com/" | |
6379 "wiki/BundleFeature for more " | |
6380 "information")) | |
6375 finally: | 6381 finally: |
6376 if tr: | 6382 if tr: |
6377 tr.release() | 6383 tr.release() |
6378 changes = [r.get('result', 0) | 6384 changes = [r.get('result', 0) |
6379 for r in op.records['changegroup']] | 6385 for r in op.records['changegroup']] |