diff --git a/mercurial/hg.py b/mercurial/hg.py index cf532a62e337645e949da9529c41ff1a5ab4d981_bWVyY3VyaWFsL2hnLnB5..0ebd94ac56d13862df511c8e56c76238c5d282d4_bWVyY3VyaWFsL2hnLnB5 100644 --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -916,8 +916,13 @@ return _incoming(display, subreporecurse, ui, repo, source, opts) def _outgoing(ui, repo, dest, opts): - dest = ui.expandpath(dest or 'default-push', dest or 'default') - dest, branches = parseurl(dest, opts.get('branch')) + path = ui.paths.getpath(dest, default=('default-push', 'default')) + if not path: + raise error.Abort(_('default repository not configured!'), + hint=_("see 'hg help config.paths'")) + dest = path.pushloc or path.loc + branches = path.branch, opts.get('branch') or [] + ui.status(_('comparing with %s\n') % util.hidepassword(dest)) revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev')) if revs: diff --git a/mercurial/revset.py b/mercurial/revset.py index cf532a62e337645e949da9529c41ff1a5ab4d981_bWVyY3VyaWFsL3JldnNldC5weQ==..0ebd94ac56d13862df511c8e56c76238c5d282d4_bWVyY3VyaWFsL3JldnNldC5weQ== 100644 --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1418,8 +1418,16 @@ l = getargs(x, 0, 1, _("outgoing takes one or no arguments")) # i18n: "outgoing" is a keyword dest = l and getstring(l[0], _("outgoing requires a repository path")) or '' - dest = repo.ui.expandpath(dest or 'default-push', dest or 'default') - dest, branches = hg.parseurl(dest) + if not dest: + # ui.paths.getpath() explicitly tests for None, not just a boolean + dest = None + path = repo.ui.paths.getpath(dest, default=('default-push', 'default')) + if not path: + raise error.Abort(_('default repository not configured!'), + hint=_("see 'hg help config.paths'")) + dest = path.pushloc or path.loc + branches = path.branch, [] + revs, checkout = hg.addbranchrevs(repo, repo, branches, []) if revs: revs = [repo.lookup(rev) for rev in revs] diff --git a/tests/test-incoming-outgoing.t b/tests/test-incoming-outgoing.t index cf532a62e337645e949da9529c41ff1a5ab4d981_dGVzdHMvdGVzdC1pbmNvbWluZy1vdXRnb2luZy50..0ebd94ac56d13862df511c8e56c76238c5d282d4_dGVzdHMvdGVzdC1pbmNvbWluZy1vdXRnb2luZy50 100644 --- a/tests/test-incoming-outgoing.t +++ b/tests/test-incoming-outgoing.t @@ -491,3 +491,63 @@ searching for changes no changes found [1] + +Create a "split" repo that pulls from r1 and pushes to r2, using default-push + + $ hg clone r1 split + updating to branch default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cat > split/.hg/hgrc << EOF + > [paths] + > default = $TESTTMP/r3 + > default-push = $TESTTMP/r2 + > EOF + $ hg -R split outgoing + comparing with $TESTTMP/r2 + searching for changes + changeset: 0:3e92d79f743a + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: a + + +Use default:pushurl instead of default-push + +Windows needs a leading slash to make a URL that passes all of the checks + $ WD=`pwd` +#if windows + $ WD="/$WD" +#endif + $ cat > split/.hg/hgrc << EOF + > [paths] + > default = $WD/r3 + > default:pushurl = file://$WD/r2 + > EOF + $ hg -R split outgoing + comparing with file:/*/$TESTTMP/r2 (glob) + searching for changes + changeset: 0:3e92d79f743a + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: a + + +Push and then double-check outgoing + + $ echo a >> split/foo + $ hg -R split commit -Ama + $ hg -R split push + pushing to file:/*/$TESTTMP/r2 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 2 changes to 1 files + $ hg -R split outgoing + comparing with file:/*/$TESTTMP/r2 (glob) + searching for changes + no changes found + [1] + diff --git a/tests/test-revset-outgoing.t b/tests/test-revset-outgoing.t index cf532a62e337645e949da9529c41ff1a5ab4d981_dGVzdHMvdGVzdC1yZXZzZXQtb3V0Z29pbmcudA==..0ebd94ac56d13862df511c8e56c76238c5d282d4_dGVzdHMvdGVzdC1yZXZzZXQtb3V0Z29pbmcudA== 100644 --- a/tests/test-revset-outgoing.t +++ b/tests/test-revset-outgoing.t @@ -105,8 +105,7 @@ green = ../a#default $ hg tout green - comparing with green - abort: repository green not found! + abort: repository green does not exist! [255] $ hg tlog -r 'outgoing("green")' @@ -110,7 +109,7 @@ [255] $ hg tlog -r 'outgoing("green")' - abort: repository green not found! + abort: repository green does not exist! [255] $ cd ..