Patchwork D10408: histedit: use `get_unique_push_path`

login
register
mail settings
Submitter phabricator
Date April 14, 2021, 11:38 p.m.
Message ID <differential-rev-PHID-DREV-gp7ztqe6kr72auqrvlhm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48726/
State Superseded
Headers show

Comments

phabricator - April 14, 2021, 11:38 p.m.
marmoute created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Same as for `pathbomb`, this code does not support multiple destinations yet. It might in the future, probably with code put in common with patchwork, but for now lets use the dedicated API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10408

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: marmoute, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1041,11 +1041,12 @@ 
     Used by initialization code"""
     if opts is None:
         opts = {}
-    dest = ui.expandpath(remote or b'default-push', remote or b'default')
-    dest, branches = urlutil.parseurl(dest, None)[:2]
+    path = urlutil.get_unique_push_path(b'histedit', repo, ui, remote)
+    dest = path.pushloc or path.loc
+
     ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest))
 
-    revs, checkout = hg.addbranchrevs(repo, repo, branches, None)
+    revs, checkout = hg.addbranchrevs(repo, repo, (path.branch, []), None)
     other = hg.peer(repo, opts, dest)
 
     if revs: