path: pass `path` to `peer` in `hg incoming` bookmark logic
We directly use the `path` object to build the `peer` object.
Touching this code highlighted that we never honor the branches' information
of when doing bookmark level incoming checks.
--- a/mercurial/commands.py Thu Dec 01 16:58:22 2022 +0100
+++ b/mercurial/commands.py Thu Dec 01 17:55:17 2022 +0100
@@ -4383,17 +4383,15 @@
if opts.get(b'bookmarks'):
srcs = urlutil.get_pull_paths(repo, ui, [source])
for path in srcs:
- source, branches = urlutil.parseurl(
- path.rawloc, opts.get(b'branch')
- )
- other = hg.peer(repo, opts, source)
+ # XXX the "branches" options are not used. Should it be used?
+ other = hg.peer(repo, opts, path)
try:
if b'bookmarks' not in other.listkeys(b'namespaces'):
ui.warn(_(b"remote doesn't support bookmarks\n"))
return 0
ui.pager(b'incoming')
ui.status(
- _(b'comparing with %s\n') % urlutil.hidepassword(source)
+ _(b'comparing with %s\n') % urlutil.hidepassword(path.loc)
)
return bookmarks.incoming(
ui, repo, other, mode=path.bookmarks_mode