Patchwork D3167: bookmarks: use isrevsymbol() for detecting collision with existing symbol

login
register
mail settings
Submitter phabricator
Date April 6, 2018, 6:43 p.m.
Message ID <differential-rev-PHID-DREV-oomu32otn7qwtdm7i3rz-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30450/
State Superseded
Headers show

Comments

phabricator - April 6, 2018, 6:43 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bookmarks.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -238,7 +238,7 @@ 
                 _("a bookmark cannot have the name of an existing branch"))
         if len(mark) > 3 and not force:
             try:
-                shadowhash = (mark in self._repo)
+                shadowhash = scmutil.isrevsymbol(self._repo, mark)
             except error.LookupError:  # ambiguous identifier
                 shadowhash = False
             if shadowhash: