diff -r 459e311f5581 -r 30ac702a7488 mercurial/commands.py --- a/mercurial/commands.py Thu Dec 01 02:09:43 2022 +0100 +++ b/mercurial/commands.py Thu Dec 01 02:11:21 2022 +0100 @@ -7283,6 +7283,7 @@ d = b'default-push' elif b'default' in ui.paths: d = b'default' + path = None if d is not None: path = urlutil.get_unique_push_path(b'summary', repo, ui, d) dest = path.loc @@ -7293,7 +7294,7 @@ revs, checkout = hg.addbranchrevs(repo, repo, (dbranch, []), None) if source != dest: try: - dother = hg.peer(repo, {}, dest) + dother = hg.peer(repo, {}, path if path is not None else dest) except error.RepoError: if opts.get(b'remote'): raise