revset: fix outgoing argument handling stable
authorWagner Bruna <wbruna@softwareexpress.com.br>
Thu, 12 Aug 2010 20:54:34 -0300
branchstable
changeset 11882 b75dea24e296
parent 11881 2da0cf99b642
child 11884 932448701e7d
revset: fix outgoing argument handling
mercurial/revset.py
tests/test-revset
tests/test-revset.out
--- a/mercurial/revset.py	Sun Aug 15 17:33:03 2010 +0200
+++ b/mercurial/revset.py	Thu Aug 12 20:54:34 2010 -0300
@@ -429,7 +429,7 @@
 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)
--- a/tests/test-revset	Sun Aug 15 17:33:03 2010 +0200
+++ b/tests/test-revset	Thu Aug 12 20:54:34 2010 -0300
@@ -57,6 +57,11 @@
 
 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 '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())'
--- a/tests/test-revset.out	Sun Aug 15 17:33:03 2010 +0200
+++ b/tests/test-revset.out	Thu Aug 12 20:54:34 2010 -0300
@@ -156,6 +156,18 @@
 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())'