Show More
@@ -1420,58 +1420,44 b' def incoming(ui, repo, source, opts, sub' | |||||
1420 | ) |
|
1420 | ) | |
1421 |
|
1421 | |||
1422 |
|
1422 | |||
1423 | _no_subtoppath = object() |
|
|||
1424 |
|
||||
1425 |
|
||||
1426 | def _outgoing(ui, repo, dests, opts, subpath=None): |
|
1423 | def _outgoing(ui, repo, dests, opts, subpath=None): | |
1427 | out = set() |
|
1424 | out = set() | |
1428 | others = [] |
|
1425 | others = [] | |
1429 | for path in urlutil.get_push_paths(repo, ui, dests): |
|
1426 | for path in urlutil.get_push_paths(repo, ui, dests): | |
1430 | dest = path.loc |
|
1427 | dest = path.loc | |
1431 | prev_subtopath = getattr(repo, "_subtoppath", _no_subtoppath) |
|
1428 | repo._subtoppath = dest | |
1432 | try: |
|
1429 | if subpath is not None: | |
1433 |
|
|
1430 | subpath = urlutil.url(subpath) | |
1434 |
if subpath |
|
1431 | if subpath.isabs(): | |
1435 |
s |
|
1432 | dest = bytes(subpath) | |
1436 | if subpath.isabs(): |
|
1433 | else: | |
1437 | dest = bytes(subpath) |
|
1434 | p = urlutil.url(dest) | |
|
1435 | if p.islocal(): | |||
|
1436 | normpath = os.path.normpath | |||
1438 | else: |
|
1437 | else: | |
1439 | p = urlutil.url(dest) |
|
1438 | normpath = posixpath.normpath | |
1440 | if p.islocal(): |
|
1439 | p.path = normpath(b'%s/%s' % (p.path, subpath)) | |
1441 | normpath = os.path.normpath |
|
1440 | dest = bytes(p) | |
1442 | else: |
|
1441 | branches = path.branch, opts.get(b'branch') or [] | |
1443 | normpath = posixpath.normpath |
|
|||
1444 | p.path = normpath(b'%s/%s' % (p.path, subpath)) |
|
|||
1445 | dest = bytes(p) |
|
|||
1446 | branches = path.branch, opts.get(b'branch') or [] |
|
|||
1447 |
|
1442 | |||
1448 |
|
|
1443 | ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest)) | |
1449 |
|
|
1444 | revs, checkout = addbranchrevs(repo, repo, branches, opts.get(b'rev')) | |
1450 | repo, repo, branches, opts.get(b'rev') |
|
1445 | if revs: | |
|
1446 | revs = [repo[rev].node() for rev in logcmdutil.revrange(repo, revs)] | |||
|
1447 | ||||
|
1448 | other = peer(repo, opts, dest) | |||
|
1449 | try: | |||
|
1450 | outgoing = discovery.findcommonoutgoing( | |||
|
1451 | repo, other, revs, force=opts.get(b'force') | |||
1451 | ) |
|
1452 | ) | |
1452 | if revs: |
|
1453 | o = outgoing.missing | |
1453 | revs = [ |
|
1454 | out.update(o) | |
1454 | repo[rev].node() for rev in logcmdutil.revrange(repo, revs) |
|
1455 | if not o: | |
1455 | ] |
|
1456 | scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) | |
1456 |
|
1457 | others.append(other) | ||
1457 | other = peer(repo, opts, dest) |
|
1458 | except: # re-raises | |
1458 |
|
|
1459 | other.close() | |
1459 | outgoing = discovery.findcommonoutgoing( |
|
1460 | raise | |
1460 | repo, other, revs, force=opts.get(b'force') |
|
|||
1461 | ) |
|
|||
1462 | o = outgoing.missing |
|
|||
1463 | out.update(o) |
|
|||
1464 | if not o: |
|
|||
1465 | scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) |
|
|||
1466 | others.append(other) |
|
|||
1467 | except: # re-raises |
|
|||
1468 | other.close() |
|
|||
1469 | raise |
|
|||
1470 | finally: |
|
|||
1471 | if prev_subtopath is _no_subtoppath: |
|
|||
1472 | del repo._subtoppath |
|
|||
1473 | else: |
|
|||
1474 | repo._subtoppath = prev_subtopath |
|
|||
1475 | # make sure this is ordered by revision number |
|
1461 | # make sure this is ordered by revision number | |
1476 | outgoing_revs = list(out) |
|
1462 | outgoing_revs = list(out) | |
1477 | cl = repo.changelog |
|
1463 | cl = repo.changelog | |
@@ -1543,6 +1529,7 b' def outgoing(ui, repo, dests, opts, subp' | |||||
1543 | finally: |
|
1529 | finally: | |
1544 | for oth in others: |
|
1530 | for oth in others: | |
1545 | oth.close() |
|
1531 | oth.close() | |
|
1532 | del repo._subtoppath | |||
1546 |
|
1533 | |||
1547 |
|
1534 | |||
1548 | def verify(repo, level=None): |
|
1535 | def verify(repo, level=None): |
General Comments 0
You need to be logged in to leave comments.
Login now