# HG changeset patch # User Pierre-Yves David # Date 1669913717 -3600 # Node ID f2f4ec857f78345ee59b770eee4c901b2cbd2d5b # Parent d4926e08507d66525300f1c49c62b976e2fa3f03 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. diff -r d4926e08507d -r f2f4ec857f78 mercurial/commands.py --- 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