mharbison72 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers.
REVISION SUMMARY Otherwise the clone command will emit a long stacktrace if there is no `=` character. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D7969 AFFECTED FILES mercurial/exchange.py tests/test-clonebundles.t CHANGE DETAILS diff --git a/tests/test-clonebundles.t b/tests/test-clonebundles.t --- a/tests/test-clonebundles.t +++ b/tests/test-clonebundles.t @@ -455,6 +455,13 @@ no changes found 2 local changesets published +Test a bad attribute list + + $ hg --config ui.clonebundleprefers=bad clone -U http://localhost:$HGPORT bad-input + abort: invalid ui.clonebundleprefers item: bad + (each comma separated item should be key=value pairs) + [255] + Test interaction between clone bundles and --stream A manifest with just a gzip bundle diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -3072,7 +3072,15 @@ if not prefers: return list(entries) - prefers = [p.split(b'=', 1) for p in prefers] + def _split(p): + if b'=' not in p: + hint = _(b"each comma separated item should be key=value pairs") + raise error.Abort( + _(b"invalid ui.clonebundleprefers item: %s") % p, hint=hint + ) + return p.split(b'=', 1) + + prefers = [_split(p) for p in prefers] items = sorted(clonebundleentry(v, prefers) for v in entries) return [i.value for i in items] To: mharbison72, #hg-reviewers Cc: mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel