##// END OF EJS Templates
infinitepush: use the new function to determine push destination...
marmoute -
r47673:6071bfab default
parent child Browse files
Show More
@@ -811,7 +811,7 b' def _findcommonincoming(orig, *args, **k'
811 return common, True, remoteheads
811 return common, True, remoteheads
812
812
813
813
814 def _push(orig, ui, repo, dest=None, *args, **opts):
814 def _push(orig, ui, repo, *dests, **opts):
815 opts = pycompat.byteskwargs(opts)
815 opts = pycompat.byteskwargs(opts)
816 bookmark = opts.get(b'bookmark')
816 bookmark = opts.get(b'bookmark')
817 # we only support pushing one infinitepush bookmark at once
817 # we only support pushing one infinitepush bookmark at once
@@ -839,18 +839,18 b' def _push(orig, ui, repo, dest=None, *ar'
839 oldphasemove = extensions.wrapfunction(
839 oldphasemove = extensions.wrapfunction(
840 exchange, b'_localphasemove', _phasemove
840 exchange, b'_localphasemove', _phasemove
841 )
841 )
842 # Copy-paste from `push` command
842
843 path = ui.getpath(dest, default=(b'default-push', b'default'))
843 paths = list(urlutil.get_push_paths(repo, ui, dests))
844 if not path:
844 if len(paths) > 1:
845 raise error.Abort(
845 msg = _(b'cannot push to multiple path with infinitepush')
846 _(b'default repository not configured!'),
846 raise error.Abort(msg)
847 hint=_(b"see 'hg help config.paths'"),
847
848 )
848 path = paths[0]
849 destpath = path.pushloc or path.loc
849 destpath = path.pushloc or path.loc
850 # Remote scratch bookmarks will be deleted because remotenames doesn't
850 # Remote scratch bookmarks will be deleted because remotenames doesn't
851 # know about them. Let's save it before push and restore after
851 # know about them. Let's save it before push and restore after
852 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath)
852 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath)
853 result = orig(ui, repo, dest, *args, **pycompat.strkwargs(opts))
853 result = orig(ui, repo, *dests, **pycompat.strkwargs(opts))
854 if common.isremotebooksenabled(ui):
854 if common.isremotebooksenabled(ui):
855 if bookmark and scratchpush:
855 if bookmark and scratchpush:
856 other = hg.peer(repo, opts, destpath)
856 other = hg.peer(repo, opts, destpath)
General Comments 0
You need to be logged in to leave comments. Login now