comparison hgext/bookmarks.py @ 11444:b9a46acdfe1f stable

bookmarks: fix in/out return values
author Matt Mackall <mpm@selenic.com>
date Sat, 26 Jun 2010 12:26:03 -0500
parents 9e1bc1aafdb1
children e5aaaef91a27
comparison
equal deleted inserted replaced
11443:9e1bc1aafdb1 11444:b9a46acdfe1f
461 for k in diff: 461 for k in diff:
462 ui.write(" %-25s %s\n" % (k, rmarks[k][:12])) 462 ui.write(" %-25s %s\n" % (k, rmarks[k][:12]))
463 463
464 if len(diff) <= 0: 464 if len(diff) <= 0:
465 ui.status(_("no changes found\n")) 465 ui.status(_("no changes found\n"))
466 return 1
467 return 0
466 468
467 def incoming(oldincoming, ui, repo, source="default", **opts): 469 def incoming(oldincoming, ui, repo, source="default", **opts):
468 if opts.get('bookmarks'): 470 if opts.get('bookmarks'):
469 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) 471 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
470 other = hg.repository(hg.remoteui(repo, opts), source) 472 other = hg.repository(hg.remoteui(repo, opts), source)
471 ui.status(_('comparing with %s\n') % url.hidepassword(source)) 473 ui.status(_('comparing with %s\n') % url.hidepassword(source))
472 diffbookmarks(ui, repo, other) 474 return diffbookmarks(ui, repo, other)
473 else: 475 else:
474 oldincoming(ui, repo, source, **opts) 476 return oldincoming(ui, repo, source, **opts)
475 477
476 def outgoing(oldoutgoing, ui, repo, dest=None, **opts): 478 def outgoing(oldoutgoing, ui, repo, dest=None, **opts):
477 if opts.get('bookmarks'): 479 if opts.get('bookmarks'):
478 dest = ui.expandpath(dest or 'default-push', dest or 'default') 480 dest = ui.expandpath(dest or 'default-push', dest or 'default')
479 dest, branches = hg.parseurl(dest, opts.get('branch')) 481 dest, branches = hg.parseurl(dest, opts.get('branch'))
480 other = hg.repository(hg.remoteui(repo, opts), dest) 482 other = hg.repository(hg.remoteui(repo, opts), dest)
481 ui.status(_('comparing with %s\n') % url.hidepassword(dest)) 483 ui.status(_('comparing with %s\n') % url.hidepassword(dest))
482 diffbookmarks(ui, other, repo) 484 return diffbookmarks(ui, other, repo)
483 else: 485 else:
484 oldoutgoing(ui, repo, dest, **opts) 486 return oldoutgoing(ui, repo, dest, **opts)
485 487
486 def uisetup(ui): 488 def uisetup(ui):
487 extensions.wrapfunction(repair, "strip", strip) 489 extensions.wrapfunction(repair, "strip", strip)
488 if ui.configbool('bookmarks', 'track.current'): 490 if ui.configbool('bookmarks', 'track.current'):
489 extensions.wrapcommand(commands.table, 'update', updatecurbookmark) 491 extensions.wrapcommand(commands.table, 'update', updatecurbookmark)