bookmarks: allow `updatefromremote` to be quiet
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 02 Oct 2014 12:16:07 -0500
changeset 22644 1ec7cdaf898f
parent 22643 3b1c0e1ede4c
child 22645 6e431e1635b6
bookmarks: allow `updatefromremote` to be quiet This will be useful to use the function during clone (clone is not printing any bookmark data right now)
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Thu Oct 02 12:39:37 2014 -0500
+++ b/mercurial/bookmarks.py	Thu Oct 02 12:16:07 2014 -0500
@@ -353,17 +353,22 @@
     (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
      ) = compare(repo, remotemarks, localmarks, dsthex=hex)
 
+    status = ui.status
+    warn = ui.warn
+    if ui.configbool('ui', 'quietbookmarkmove', False):
+        status = warn = ui.debug
+
     changed = []
     for b, scid, dcid in addsrc:
         if scid in repo: # add remote bookmarks for changes we already have
-            changed.append((b, bin(scid), ui.status,
+            changed.append((b, bin(scid), status,
                             _("adding remote bookmark %s\n") % (b)))
     for b, scid, dcid in advsrc:
-        changed.append((b, bin(scid), ui.status,
+        changed.append((b, bin(scid), status,
                         _("updating bookmark %s\n") % (b)))
     for b, scid, dcid in diverge:
         db = _diverge(ui, b, path, localmarks)
-        changed.append((db, bin(scid), ui.warn,
+        changed.append((db, bin(scid), warn,
                         _("divergent bookmark %s stored as %s\n") % (b, db)))
     if changed:
         for b, node, writer, msg in sorted(changed):