##// END OF EJS Templates
bookmarks: add incoming() to replace diff() for incoming bookmarks...
FUJIWARA Katsunori -
r24397:d0ea2028 default
parent child Browse files
Show More
@@ -442,6 +442,34 b' def updatefromremote(ui, repo, remotemar'
442 writer(msg)
442 writer(msg)
443 localmarks.recordchange(tr)
443 localmarks.recordchange(tr)
444
444
445 def incoming(ui, repo, other):
446 '''Show bookmarks incoming from other to repo
447 '''
448 ui.status(_("searching for changed bookmarks\n"))
449
450 r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
451 dsthex=hex)
452 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
453
454 incomings = []
455 if ui.debugflag:
456 getid = lambda id: id
457 else:
458 getid = lambda id: id[:12]
459 def add(b, id):
460 incomings.append(" %-25s %s\n" % (b, getid(id)))
461 for b, scid, dcid in addsrc:
462 add(b, scid)
463
464 if not incomings:
465 ui.status(_("no changed bookmarks found\n"))
466 return 1
467
468 for s in sorted(incomings):
469 ui.write(s)
470
471 return 0
472
445 def diff(ui, dst, src):
473 def diff(ui, dst, src):
446 ui.status(_("searching for changed bookmarks\n"))
474 ui.status(_("searching for changed bookmarks\n"))
447
475
@@ -4302,7 +4302,7 b' def incoming(ui, repo, source="default",'
4302 ui.warn(_("remote doesn't support bookmarks\n"))
4302 ui.warn(_("remote doesn't support bookmarks\n"))
4303 return 0
4303 return 0
4304 ui.status(_('comparing with %s\n') % util.hidepassword(source))
4304 ui.status(_('comparing with %s\n') % util.hidepassword(source))
4305 return bookmarks.diff(ui, repo, other)
4305 return bookmarks.incoming(ui, repo, other)
4306
4306
4307 repo._subtoppath = ui.expandpath(source)
4307 repo._subtoppath = ui.expandpath(source)
4308 try:
4308 try:
General Comments 0
You need to be logged in to leave comments. Login now