# HG changeset patch # User Valentin Gatien-Baron # Date 1581796293 18000 # Node ID edaae3616ba30cb6c1de1365f6933367729dc905 # Parent 815c63526d1d6493bd89f3191a1c1e0cf28a94b7 bookmarks: avoid traceback when two pushes race to delete the same bookmark `hg push -f -B remote-only-bookmark` can raise server-side in `bookmarks._del` (specifically in `self._refmap.pop(mark)`), if the remote-only bookmark got deleted concurrently. Fix this by simply not deleting the non-existent bookmark in that case. For avoidance of doubt, refusing to delete a bookmark that doesn't exist when the push starts is taking care of elsewhere; no change of behavior there. Differential Revision: https://phab.mercurial-scm.org/D8124 diff -r 815c63526d1d -r edaae3616ba3 mercurial/bookmarks.py --- a/mercurial/bookmarks.py Sat Feb 15 15:06:41 2020 -0500 +++ b/mercurial/bookmarks.py Sat Feb 15 14:51:33 2020 -0500 @@ -173,6 +173,8 @@ nrefs.sort() def _del(self, mark): + if mark not in self._refmap: + return self._clean = False node = self._refmap.pop(mark) nrefs = self._nodemap[node] diff -r 815c63526d1d -r edaae3616ba3 relnotes/next --- a/relnotes/next Sat Feb 15 15:06:41 2020 -0500 +++ b/relnotes/next Sat Feb 15 14:51:33 2020 -0500 @@ -27,6 +27,7 @@ == Bug Fixes == + * Fix server exception when concurrent pushes delete the same bookmark == Backwards Compatibility Changes ==