Patchwork D8124: bookmarks: avoid traceback when two pushes race to delete the same bookmark

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2020, 9:55 a.m.
Message ID <a23a969fc56bbaff8e52e1d4fe078036@localhost.localdomain>
Download mbox | patch
Permalink /patch/45283/
State Not Applicable
Headers show

Comments

phabricator - Feb. 21, 2020, 9:55 a.m.
Closed by commit rHGedaae3616ba3: bookmarks: avoid traceback when two pushes race to delete the same bookmark (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8124?vs=20247&id=20270

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8124/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8124

AFFECTED FILES
  mercurial/bookmarks.py
  relnotes/next

CHANGE DETAILS




To: valentin.gatienbaron, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -27,6 +27,7 @@ 
 
 == Bug Fixes  ==
 
+ * Fix server exception when concurrent pushes delete the same bookmark
 
 == Backwards Compatibility Changes ==
 
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -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]