diff tests/test-subrepo-relative-path.t @ 38203:dfb888aae17a

outgoing: pay attention to `default:pushurl` for bookmarks and subrepos The problem here was that `default:pushurl` and `default` get translated to a single entry in `ui.paths` named 'default', with an attribute for 'pushloc', 'loc', and 'rawloc'. ui.expandpath() then always takes the `rawloc` attribute. Maybe the ui.expandpath() API is busted and should be removed? Or maybe getpath() should return a copy that adds an attribute reflecting the URL of the path chosen? I thought that I could remove the code in hg._outgoing() and pass the location resolved in commands.py as `dest`, but unfortunately that code is needed there to resolve #branch type URLs. Maybe that should be pulled up to commands.py, because I can't see any reasonable behavior for a subrepo path that's constructed out of that type of URL. The push command already resolves this early, so that works properly. But it looks like bundle, histedit, largefiles, patchbomb, and summary use a similar pattern, so they are likely similarly affected.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 28 May 2018 01:36:34 -0400
parents b4b7427b5786
children 41ac8ea1bdd7
line wrap: on
line diff
--- a/tests/test-subrepo-relative-path.t	Sat Apr 21 17:27:57 2018 +0200
+++ b/tests/test-subrepo-relative-path.t	Mon May 28 01:36:34 2018 -0400
@@ -56,6 +56,30 @@
   new changesets 863c1745b441
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+Ensure that subrepos pay attention to default:pushurl
+
+  $ cat > cloned/.hg/hgrc << EOF
+  > [paths]
+  > default:pushurl = http://localhost:$HGPORT/main
+  > EOF
+
+  $ hg -R cloned out -S --config paths.default=bogus://invalid
+  comparing with http://localhost:$HGPORT/main
+  searching for changes
+  no changes found
+  comparing with http://localhost:$HGPORT/sub
+  searching for changes
+  no changes found
+  [1]
+
+  $ hg -R cloned push --config paths.default=bogus://invalid
+  pushing to http://localhost:$HGPORT/main
+  no changes made to subrepo sub since last push to http://localhost:$HGPORT/sub
+  searching for changes
+  no changes found
+  abort: HTTP Error 403: ssl required
+  [255]
+
 Checking cloned repo ids
 
   $ hg id -R cloned