diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -564,6 +564,10 @@ def bundle(ui, repo, fname, dest=None, * 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: diff --git a/tests/test-bundle-r b/tests/test-bundle-r --- a/tests/test-bundle-r +++ b/tests/test-bundle-r @@ -72,6 +72,8 @@ hg -R test bundle --base 2 -r tip test-b 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 diff --git a/tests/test-bundle-r.out b/tests/test-bundle-r.out --- a/tests/test-bundle-r.out +++ b/tests/test-bundle-r.out @@ -162,6 +162,7 @@ 2 changesets found 4 changesets found 6 changesets found 1 changesets found +no changes found 1 changesets found 4 changesets found updating to branch default