patchbomb: handle repository#rev URLs correctly stable
authorSune Foldager <cryo@cyanite.org>
Sun, 06 Dec 2009 23:22:17 +0100
branchstable
changeset 10018 4ddfad7ebd98
parent 9996 2770d03ae49f
child 10019 4e3a8f3e9dc2
child 10022 585f51f8b5f0
patchbomb: handle repository#rev URLs correctly
hgext/patchbomb.py
tests/test-patchbomb
tests/test-patchbomb.out
--- a/hgext/patchbomb.py	Thu Dec 03 11:06:55 2009 +0100
+++ b/hgext/patchbomb.py	Sun Dec 06 23:22:17 2009 +0100
@@ -230,6 +230,7 @@
     def outgoing(dest, revs):
         '''Return the revisions present locally but not in dest'''
         dest = ui.expandpath(dest or 'default-push', dest or 'default')
+        dest, revs, checkout = hg.parseurl(dest, revs)
         revs = [repo.lookup(rev) for rev in revs]
         other = hg.repository(cmdutil.remoteui(repo, opts), dest)
         ui.status(_('comparing with %s\n') % dest)
--- a/tests/test-patchbomb	Thu Dec 03 11:06:55 2009 +0100
+++ b/tests/test-patchbomb	Sun Dec 06 23:22:17 2009 +0100
@@ -176,3 +176,11 @@
 hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" \
   -s test -r 0
 cat tmp.mbox | fixheaders
+
+echo "% test outgoing and dest#branch URIs"
+hg up 1
+hg branch test
+echo d > d
+hg add d
+hg ci -md -d '4 0'
+hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test | fixheaders
--- a/tests/test-patchbomb.out	Thu Dec 03 11:06:55 2009 +0100
+++ b/tests/test-patchbomb.out	Sun Dec 06 23:22:17 2009 +0100
@@ -1500,3 +1500,38 @@
 +a
 
 
+% test outgoing and dest#branch URIs
+0 files updated, 0 files merged, 6 files removed, 0 files unresolved
+marked working directory as branch test
+created new head
+comparing with ../t
+searching for changes
+This patch series consists of 1 patches.
+
+
+Displaying [PATCH] test ...
+Content-Type: text/plain; charset="us-ascii"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [PATCH] test
+X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@
+User-Agent: Mercurial-patchbomb
+Date: Tue, 01 Jan 1980 00:01:00 +0000
+From: test
+To: foo
+
+# HG changeset patch
+# User test
+# Date 4 0
+# Branch test
+# Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+d
+
+diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/d	Thu Jan 01 00:00:04 1970 +0000
+@@ -0,0 +1,1 @@
++d
+