comparison mercurial/bookmarks.py @ 22652:15bc5ea297f5

bookmark: remove now unused `pushtoremote` function Everything is unified in the push discovery now.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 26 Sep 2014 23:04:35 -0700
parents 1ec7cdaf898f
children a8f0d8e4c80a
comparison
equal deleted inserted replaced
22651:b901645a8784 22652:15bc5ea297f5
374 for b, node, writer, msg in sorted(changed): 374 for b, node, writer, msg in sorted(changed):
375 localmarks[b] = node 375 localmarks[b] = node
376 writer(msg) 376 writer(msg)
377 localmarks.write() 377 localmarks.write()
378 378
379 def pushtoremote(ui, repo, remote, targets):
380 (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
381 ) = compare(repo, repo._bookmarks, remote.listkeys('bookmarks'),
382 srchex=hex, targets=targets)
383 if invalid:
384 b, scid, dcid = invalid[0]
385 ui.warn(_('bookmark %s does not exist on the local '
386 'or remote repository!\n') % b)
387 return 2
388
389 def push(b, old, new):
390 r = remote.pushkey('bookmarks', b, old, new)
391 if not r:
392 ui.warn(_('updating bookmark %s failed!\n') % b)
393 return 1
394 return 0
395 failed = 0
396 for b, scid, dcid in sorted(addsrc + advsrc + advdst + diverge + differ):
397 ui.status(_("exporting bookmark %s\n") % b)
398 if dcid is None:
399 dcid = ''
400 failed += push(b, dcid, scid)
401 for b, scid, dcid in adddst:
402 # treat as "deleted locally"
403 ui.status(_("deleting remote bookmark %s\n") % b)
404 failed += push(b, dcid, '')
405
406 if failed:
407 return 1
408
409 def diff(ui, dst, src): 379 def diff(ui, dst, src):
410 ui.status(_("searching for changed bookmarks\n")) 380 ui.status(_("searching for changed bookmarks\n"))
411 381
412 smarks = src.listkeys('bookmarks') 382 smarks = src.listkeys('bookmarks')
413 dmarks = dst.listkeys('bookmarks') 383 dmarks = dst.listkeys('bookmarks')