comparison mercurial/bookmarks.py @ 22644:1ec7cdaf898f

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)
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 02 Oct 2014 12:16:07 -0500
parents b3f74b405c20
children 15bc5ea297f5
comparison
equal deleted inserted replaced
22643:3b1c0e1ede4c 22644:1ec7cdaf898f
351 ui.debug("checking for updated bookmarks\n") 351 ui.debug("checking for updated bookmarks\n")
352 localmarks = repo._bookmarks 352 localmarks = repo._bookmarks
353 (addsrc, adddst, advsrc, advdst, diverge, differ, invalid 353 (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
354 ) = compare(repo, remotemarks, localmarks, dsthex=hex) 354 ) = compare(repo, remotemarks, localmarks, dsthex=hex)
355 355
356 status = ui.status
357 warn = ui.warn
358 if ui.configbool('ui', 'quietbookmarkmove', False):
359 status = warn = ui.debug
360
356 changed = [] 361 changed = []
357 for b, scid, dcid in addsrc: 362 for b, scid, dcid in addsrc:
358 if scid in repo: # add remote bookmarks for changes we already have 363 if scid in repo: # add remote bookmarks for changes we already have
359 changed.append((b, bin(scid), ui.status, 364 changed.append((b, bin(scid), status,
360 _("adding remote bookmark %s\n") % (b))) 365 _("adding remote bookmark %s\n") % (b)))
361 for b, scid, dcid in advsrc: 366 for b, scid, dcid in advsrc:
362 changed.append((b, bin(scid), ui.status, 367 changed.append((b, bin(scid), status,
363 _("updating bookmark %s\n") % (b))) 368 _("updating bookmark %s\n") % (b)))
364 for b, scid, dcid in diverge: 369 for b, scid, dcid in diverge:
365 db = _diverge(ui, b, path, localmarks) 370 db = _diverge(ui, b, path, localmarks)
366 changed.append((db, bin(scid), ui.warn, 371 changed.append((db, bin(scid), warn,
367 _("divergent bookmark %s stored as %s\n") % (b, db))) 372 _("divergent bookmark %s stored as %s\n") % (b, db)))
368 if changed: 373 if changed:
369 for b, node, writer, msg in sorted(changed): 374 for b, node, writer, msg in sorted(changed):
370 localmarks[b] = node 375 localmarks[b] = node
371 writer(msg) 376 writer(msg)