bundle: fix bundle generation for empty changegroup stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Tue, 09 Mar 2010 20:38:23 +0100
branchstable
changeset 10616 65b178f30eae
parent 10612 30553ac3e355
child 10617 da7662ea741f
child 10618 508fda6b8637
bundle: fix bundle generation for empty changegroup
mercurial/commands.py
tests/test-bundle-r
tests/test-bundle-r.out
--- a/mercurial/commands.py	Tue Mar 09 16:03:57 2010 +0100
+++ b/mercurial/commands.py	Tue Mar 09 20:38:23 2010 +0100
@@ -564,6 +564,10 @@
         revs, checkout = hg.addbranchrevs(repo, other, branches, revs)
         o = repo.findoutgoing(other, force=opts.get('force'))
 
+    if not o:
+        ui.status(_("no changes found\n"))
+        return
+
     if revs:
         cg = repo.changegroupsubset(o, revs, 'bundle')
     else:
--- a/tests/test-bundle-r	Tue Mar 09 16:03:57 2010 +0100
+++ b/tests/test-bundle-r	Tue Mar 09 20:38:23 2010 +0100
@@ -72,6 +72,8 @@
 hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
 hg -R test bundle --base 2 test-bundle-all.hg
 hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
+# empty bundle
+hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
 
 # issue76 msg2163
 hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
--- a/tests/test-bundle-r.out	Tue Mar 09 16:03:57 2010 +0100
+++ b/tests/test-bundle-r.out	Tue Mar 09 20:38:23 2010 +0100
@@ -162,6 +162,7 @@
 4 changesets found
 6 changesets found
 1 changesets found
+no changes found
 1 changesets found
 4 changesets found
 updating to branch default