mercurial/hg.py
branchstable
changeset 52081 653b7a19f1de
parent 52080 75123bc60b66
child 52082 fb15ba66c702
equal deleted inserted replaced
52080:75123bc60b66 52081:653b7a19f1de
  1493 def _outgoing(ui, repo, dests, opts, subpath=None):
  1493 def _outgoing(ui, repo, dests, opts, subpath=None):
  1494     out = set()
  1494     out = set()
  1495     others = []
  1495     others = []
  1496     for path in urlutil.get_push_paths(repo, ui, dests):
  1496     for path in urlutil.get_push_paths(repo, ui, dests):
  1497         dest = path.loc
  1497         dest = path.loc
  1498         if subpath is not None:
  1498         if True:
  1499             subpath = urlutil.url(subpath)
  1499             if subpath is not None:
  1500             if subpath.isabs():
  1500                 subpath = urlutil.url(subpath)
  1501                 dest = bytes(subpath)
  1501                 if subpath.isabs():
  1502             else:
  1502                     dest = bytes(subpath)
  1503                 p = urlutil.url(dest)
       
  1504                 if p.islocal():
       
  1505                     normpath = os.path.normpath
       
  1506                 else:
  1503                 else:
  1507                     normpath = posixpath.normpath
  1504                     p = urlutil.url(dest)
  1508                 p.path = normpath(b'%s/%s' % (p.path, subpath))
  1505                     if p.islocal():
  1509                 dest = bytes(p)
  1506                         normpath = os.path.normpath
  1510         branches = path.branch, opts.get(b'branch') or []
  1507                     else:
  1511 
  1508                         normpath = posixpath.normpath
  1512         ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest))
  1509                     p.path = normpath(b'%s/%s' % (p.path, subpath))
  1513         revs, checkout = addbranchrevs(repo, repo, branches, opts.get(b'rev'))
  1510                     dest = bytes(p)
  1514         if revs:
  1511             branches = path.branch, opts.get(b'branch') or []
  1515             revs = [repo[rev].node() for rev in logcmdutil.revrange(repo, revs)]
  1512 
  1516 
  1513             ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest))
  1517         other = peer(repo, opts, dest)
  1514             revs, checkout = addbranchrevs(
  1518         try:
  1515                 repo, repo, branches, opts.get(b'rev')
  1519             outgoing = discovery.findcommonoutgoing(
       
  1520                 repo, other, revs, force=opts.get(b'force')
       
  1521             )
  1516             )
  1522             o = outgoing.missing
  1517             if revs:
  1523             out.update(o)
  1518                 revs = [
  1524             if not o:
  1519                     repo[rev].node() for rev in logcmdutil.revrange(repo, revs)
  1525                 scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)
  1520                 ]
  1526             others.append(other)
  1521 
  1527         except:  # re-raises
  1522             other = peer(repo, opts, dest)
  1528             other.close()
  1523             try:
  1529             raise
  1524                 outgoing = discovery.findcommonoutgoing(
       
  1525                     repo, other, revs, force=opts.get(b'force')
       
  1526                 )
       
  1527                 o = outgoing.missing
       
  1528                 out.update(o)
       
  1529                 if not o:
       
  1530                     scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)
       
  1531                 others.append(other)
       
  1532             except:  # re-raises
       
  1533                 other.close()
       
  1534                 raise
  1530     return list(out), others
  1535     return list(out), others
  1531 
  1536 
  1532 
  1537 
  1533 def verify(repo, level=None):
  1538 def verify(repo, level=None):
  1534     """verify the consistency of a repository"""
  1539     """verify the consistency of a repository"""