Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 52555:85c095c1f8bc
subrepo: fix calling outgoing with multiple paths
When recursing into a subrepository all the paths were being passed on to them.
However, each subrepository is mapped to only one destination (subrepository
state uses the destination to derive the final path). The for loop is
responsible for recursing into the subrepository for each destination so we
only need to pass the current destination.
If we have the following repository structure parent/sub/sub_sub, and call
outgoing to parent_p1 and parent_p2, the outgoing method will be called with
the following arguments:
dests = (parent_p1, parent_p2), subpath = None
dests = (parent_p1 path.loc, ), subpath = sub
dests = (parent_p1 path.loc, ), subpath = sub/sub_sub
dests = (parent_p2 path.loc, ), subpath = sub
dests = (parent_p2 path.loc, ), subpath = sub/sub_sub
Then, the subrepositories absolute path will be formed concatenating both
arguments. If subpath is absolute, dests is ignored.
author | Felipe Resende <felipe@fcresende.dev.br> |
---|---|
date | Sun, 22 Dec 2024 08:17:53 -0300 |
parents | 19ae7730636a |
children | e627cc25b6f3 |
comparison
equal
deleted
inserted
replaced
52554:0eb262968b2b | 52555:85c095c1f8bc |
---|---|
1525 else: | 1525 else: |
1526 ret = 0 | 1526 ret = 0 |
1527 display_outgoing_revs(ui, repo, o, opts) | 1527 display_outgoing_revs(ui, repo, o, opts) |
1528 | 1528 |
1529 cmdutil.outgoinghooks(ui, repo, other, opts, o) | 1529 cmdutil.outgoinghooks(ui, repo, other, opts, o) |
1530 ret = min(ret, _outgoing_recurse(ui, repo, dests, opts)) | 1530 |
1531 # path.loc is used instead of dest because what we need to pass | |
1532 # is the destination of the repository containing the | |
1533 # subrepositories and not the destination of the current | |
1534 # subrepository being processed. It will be used to discover | |
1535 # subrepositories paths when using relative paths do map them | |
1536 ret = min(ret, _outgoing_recurse(ui, repo, (path.loc,), opts)) | |
1531 except: # re-raises | 1537 except: # re-raises |
1532 raise | 1538 raise |
1533 finally: | 1539 finally: |
1534 other.close() | 1540 other.close() |
1535 finally: | 1541 finally: |