diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -429,7 +429,7 @@ def roots(repo, subset, x): def outgoing(repo, subset, x): import hg # avoid start-up nasties l = getargs(x, 0, 1, _("outgoing wants a repository path")) - dest = l[1:] or '' + dest = l and getstring(l[0], _("outgoing wants a repository path")) or '' dest = repo.ui.expandpath(dest or 'default-push', dest or 'default') dest, branches = hg.parseurl(dest) other = hg.repository(hg.remoteui(repo, {}), dest) diff --git a/tests/test-revset b/tests/test-revset --- a/tests/test-revset +++ b/tests/test-revset @@ -57,6 +57,11 @@ hg ci -Aqm9 hg tag -r6 1.0 +hg clone --quiet -U -r 7 . ../remote1 +hg clone --quiet -U -r 8 . ../remote2 +echo "[paths]" >> .hg/hgrc +echo "default = ../remote1" >> .hg/hgrc + # names that should work without quoting try a try b-a @@ -112,6 +117,9 @@ log 'limit(head(), 1)' log 'max(contains(a))' log 'merge()' log 'modifies(b)' +log 'outgoing()' +log 'outgoing("../remote1")' +log 'outgoing("../remote2")' log 'p1(merge())' log 'p2(merge())' log 'parents(merge())' diff --git a/tests/test-revset.out b/tests/test-revset.out --- a/tests/test-revset.out +++ b/tests/test-revset.out @@ -156,6 +156,18 @@ 5 6 % log 'modifies(b)' 4 +% log 'outgoing()' +8 +9 +% log 'outgoing("../remote1")' +8 +9 +% log 'outgoing("../remote2")' +3 +5 +6 +7 +9 % log 'p1(merge())' 5 % log 'p2(merge())'