mercurial/commands.py
changeset 21047 f0003f989e72
parent 21045 7f875ed19475
child 21049 f117a0ba5289
equal deleted inserted replaced
21046:cc13addbd62b 21047:f0003f989e72
  5523 
  5523 
  5524     if opts.get('remote'):
  5524     if opts.get('remote'):
  5525         needsincoming, needsoutgoing = True, True
  5525         needsincoming, needsoutgoing = True, True
  5526     else:
  5526     else:
  5527         needsincoming, needsoutgoing = False, False
  5527         needsincoming, needsoutgoing = False, False
       
  5528         for i, o in cmdutil.summaryremotehooks(ui, repo, opts, None):
       
  5529             if i:
       
  5530                 needsincoming = True
       
  5531             if o:
       
  5532                 needsoutgoing = True
       
  5533         if not needsincoming and not needsoutgoing:
       
  5534             return
  5528 
  5535 
  5529     def getincoming():
  5536     def getincoming():
  5530         source, branches = hg.parseurl(ui.expandpath('default'))
  5537         source, branches = hg.parseurl(ui.expandpath('default'))
  5531         sbranch = branches[0]
  5538         sbranch = branches[0]
  5532         other = hg.peer(repo, {}, source)
  5539         try:
       
  5540             other = hg.peer(repo, {}, source)
       
  5541         except error.RepoError:
       
  5542             if opts.get('remote'):
       
  5543                 raise
       
  5544             return source, sbranch, None, None, None
  5533         revs, checkout = hg.addbranchrevs(repo, other, branches, None)
  5545         revs, checkout = hg.addbranchrevs(repo, other, branches, None)
  5534         if revs:
  5546         if revs:
  5535             revs = [other.lookup(rev) for rev in revs]
  5547             revs = [other.lookup(rev) for rev in revs]
  5536         ui.debug('comparing with %s\n' % util.hidepassword(source))
  5548         ui.debug('comparing with %s\n' % util.hidepassword(source))
  5537         repo.ui.pushbuffer()
  5549         repo.ui.pushbuffer()
  5547     def getoutgoing():
  5559     def getoutgoing():
  5548         dest, branches = hg.parseurl(ui.expandpath('default-push', 'default'))
  5560         dest, branches = hg.parseurl(ui.expandpath('default-push', 'default'))
  5549         dbranch = branches[0]
  5561         dbranch = branches[0]
  5550         revs, checkout = hg.addbranchrevs(repo, repo, branches, None)
  5562         revs, checkout = hg.addbranchrevs(repo, repo, branches, None)
  5551         if source != dest:
  5563         if source != dest:
  5552             dother = hg.peer(repo, {}, dest)
  5564             try:
       
  5565                 dother = hg.peer(repo, {}, dest)
       
  5566             except error.RepoError:
       
  5567                 if opts.get('remote'):
       
  5568                     raise
       
  5569                 return dest, dbranch, None, None
  5553             ui.debug('comparing with %s\n' % util.hidepassword(dest))
  5570             ui.debug('comparing with %s\n' % util.hidepassword(dest))
       
  5571         elif sother is None:
       
  5572             # there is no explicit destination peer, but source one is invalid
       
  5573             return dest, dbranch, None, None
  5554         else:
  5574         else:
  5555             dother = sother
  5575             dother = sother
  5556         if (source != dest or (sbranch is not None and sbranch != dbranch)):
  5576         if (source != dest or (sbranch is not None and sbranch != dbranch)):
  5557             common = None
  5577             common = None
  5558         else:
  5578         else:
  5592             # i18n: column positioning for "hg summary"
  5612             # i18n: column positioning for "hg summary"
  5593             ui.write(_('remote: %s\n') % (', '.join(t)))
  5613             ui.write(_('remote: %s\n') % (', '.join(t)))
  5594         else:
  5614         else:
  5595             # i18n: column positioning for "hg summary"
  5615             # i18n: column positioning for "hg summary"
  5596             ui.status(_('remote: (synced)\n'))
  5616             ui.status(_('remote: (synced)\n'))
       
  5617 
       
  5618     cmdutil.summaryremotehooks(ui, repo, opts,
       
  5619                                ((source, sbranch, sother, commoninc),
       
  5620                                 (dest, dbranch, dother, outgoing)))
  5597 
  5621 
  5598 @command('tag',
  5622 @command('tag',
  5599     [('f', 'force', None, _('force tag')),
  5623     [('f', 'force', None, _('force tag')),
  5600     ('l', 'local', None, _('make the tag local')),
  5624     ('l', 'local', None, _('make the tag local')),
  5601     ('r', 'rev', '', _('revision to tag'), _('REV')),
  5625     ('r', 'rev', '', _('revision to tag'), _('REV')),