mercurial/bookmarks.py
changeset 35647 fc39e2bfcd70
parent 35611 7336ac5e786e
child 35679 5a2d505a9174
--- a/mercurial/bookmarks.py	Sun Dec 10 18:25:33 2017 +0900
+++ b/mercurial/bookmarks.py	Mon Jan 15 00:16:11 2018 +0530
@@ -830,7 +830,12 @@
     cur = repo.changectx('.').node()
     newact = None
     changes = []
-    hiddenrevs = set()
+    hiddenrev = None
+
+    # unhide revs if any
+    if rev:
+        repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
+
     for mark in names:
         mark = checkformat(repo, mark)
         if newact is None:
@@ -840,17 +845,16 @@
             return
         tgt = cur
         if rev:
-            repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
             ctx = scmutil.revsingle(repo, rev)
             if ctx.hidden():
-                hiddenrevs.add(ctx.hex()[:12])
+                hiddenrev = ctx.hex()[:12]
             tgt = ctx.node()
         for bm in marks.checkconflict(mark, force, tgt):
             changes.append((bm, None))
         changes.append((mark, tgt))
-    if hiddenrevs:
-        repo.ui.warn(_("bookmarking hidden changeset %s\n") %
-                     ', '.join(hiddenrevs))
+
+    if hiddenrev:
+        repo.ui.warn(_("bookmarking hidden changeset %s\n") % hiddenrev)
     marks.applychanges(repo, tr, changes)
     if not inactive and cur == marks[newact] and not rev:
         activate(repo, newact)