[Request] [+ ] D11619: hg: use dict.get() instead, to prevent KeyError
khanchi97 (Sushil khanchi)
phabricator at mercurial-scm.org
Fri Oct 8 11:34:22 UTC 2021
khanchi97 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D11619
AFFECTED FILES
mercurial/debugcommands.py
mercurial/hg.py
CHANGE DETAILS
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1285,7 +1285,7 @@
if revs:
revs = [other.lookup(rev) for rev in revs]
other, chlist, cleanupfn = bundlerepo.getremotechanges(
- ui, repo, other, revs, opts[b"bundle"], opts[b"force"]
+ ui, repo, other, revs, opts.get(b"bundle"), opts.get(b"force")
)
if not chlist:
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -3905,7 +3905,12 @@
with ui.silent():
try:
other, chlist, cleanupfn = bundlerepo.getremotechanges(
- ui, repo, other, revs, opts[b"bundle"], opts[b"force"]
+ ui,
+ repo,
+ other,
+ revs,
+ opts.get(b"bundle"),
+ opts.get(b"force"),
)
except error.LookupError:
continue
To: khanchi97, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20211008/cc5b2e9e/attachment-0001.html>
More information about the Mercurial-patches
mailing list