Patchwork D10405: patchbomb: use `get_unique_pull_path`

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

Comments

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

REVISION SUMMARY
  The patchbomb code does not support multiple destinations yet. It would not be
  too hard to implemented since `hg outgoing` does. However that is a bit too
  much of a detour right now. In addition that kind of "select outgoing
  changesets for processing" code exist for various commands so the best would be
  to factor it out later.
  
  Let us use the dedicated API until this is solved.
  
  This comes with a small output change in the test that I find more accurate. So
  I kept it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/patchbomb.py
  tests/test-patchbomb.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -2868,7 +2868,7 @@ 
 
 dest#branch URIs:
   $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
-  comparing with ../t
+  comparing with ../t#test
   From [test]: test
   this patch series consists of 1 patches.
   
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -530,9 +530,9 @@ 
 def _getoutgoing(repo, dest, revs):
     '''Return the revisions present locally but not in dest'''
     ui = repo.ui
-    url = ui.expandpath(dest or b'default-push', dest or b'default')
-    url = urlutil.parseurl(url)[0]
-    ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(url))
+    paths = urlutil.get_push_paths(repo, ui, [dest])
+    safe_paths = [urlutil.hidepassword(p.rawloc) for p in paths]
+    ui.status(_(b'comparing with %s\n') % b','.join(safe_paths))
 
     revs = [r for r in revs if r >= 0]
     if not revs: