##// END OF EJS Templates
summary: separate checking incoming/outgoing and showing remote summary...
FUJIWARA Katsunori -
r21045:7f875ed1 default
parent child Browse files
Show More
@@ -5522,7 +5522,11 b' def summary(ui, repo, **opts):'
5522 5522 cmdutil.summaryhooks(ui, repo)
5523 5523
5524 5524 if opts.get('remote'):
5525 t = []
5525 needsincoming, needsoutgoing = True, True
5526 else:
5527 needsincoming, needsoutgoing = False, False
5528
5529 def getincoming():
5526 5530 source, branches = hg.parseurl(ui.expandpath('default'))
5527 5531 sbranch = branches[0]
5528 5532 other = hg.peer(repo, {}, source)
@@ -5532,28 +5536,48 b' def summary(ui, repo, **opts):'
5532 5536 ui.debug('comparing with %s\n' % util.hidepassword(source))
5533 5537 repo.ui.pushbuffer()
5534 5538 commoninc = discovery.findcommonincoming(repo, other, heads=revs)
5535 _common, incoming, _rheads = commoninc
5536 5539 repo.ui.popbuffer()
5537 if incoming:
5538 t.append(_('1 or more incoming'))
5539
5540 return source, sbranch, other, commoninc, commoninc[1]
5541
5542 if needsincoming:
5543 source, sbranch, sother, commoninc, incoming = getincoming()
5544 else:
5545 source = sbranch = sother = commoninc = incoming = None
5546
5547 def getoutgoing():
5540 5548 dest, branches = hg.parseurl(ui.expandpath('default-push', 'default'))
5541 5549 dbranch = branches[0]
5542 5550 revs, checkout = hg.addbranchrevs(repo, repo, branches, None)
5543 5551 if source != dest:
5544 other = hg.peer(repo, {}, dest)
5552 dother = hg.peer(repo, {}, dest)
5545 5553 ui.debug('comparing with %s\n' % util.hidepassword(dest))
5554 else:
5555 dother = sother
5546 5556 if (source != dest or (sbranch is not None and sbranch != dbranch)):
5547 commoninc = None
5557 common = None
5558 else:
5559 common = commoninc
5548 5560 if revs:
5549 5561 revs = [repo.lookup(rev) for rev in revs]
5550 5562 repo.ui.pushbuffer()
5551 outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs,
5552 commoninc=commoninc)
5563 outgoing = discovery.findcommonoutgoing(repo, dother, onlyheads=revs,
5564 commoninc=common)
5553 5565 repo.ui.popbuffer()
5566 return dest, dbranch, dother, outgoing
5567
5568 if needsoutgoing:
5569 dest, dbranch, dother, outgoing = getoutgoing()
5570 else:
5571 dest = dbranch = dother = outgoing = None
5572
5573 if opts.get('remote'):
5574 t = []
5575 if incoming:
5576 t.append(_('1 or more incoming'))
5554 5577 o = outgoing.missing
5555 5578 if o:
5556 5579 t.append(_('%d outgoing') % len(o))
5580 other = dother or sother
5557 5581 if 'bookmarks' in other.listkeys('namespaces'):
5558 5582 lmarks = repo.listkeys('bookmarks')
5559 5583 rmarks = other.listkeys('bookmarks')
General Comments 0
You need to be logged in to leave comments. Login now