diff 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
line wrap: on
line diff
--- a/mercurial/hg.py	Sun Dec 29 19:39:35 2024 -0300
+++ b/mercurial/hg.py	Sun Dec 22 08:17:53 2024 -0300
@@ -1527,7 +1527,13 @@
                     display_outgoing_revs(ui, repo, o, opts)
 
                 cmdutil.outgoinghooks(ui, repo, other, opts, o)
-                ret = min(ret, _outgoing_recurse(ui, repo, dests, opts))
+
+                # path.loc is used instead of dest because what we need to pass
+                # is the destination of the repository containing the
+                # subrepositories and not the destination of the current
+                # subrepository being processed. It will be used to discover
+                # subrepositories paths when using relative paths do map them
+                ret = min(ret, _outgoing_recurse(ui, repo, (path.loc,), opts))
             except:  # re-raises
                 raise
             finally: