diff mercurial/setdiscovery.py @ 14981:192e02680d09 stable

setdiscovery: return anyincoming=False when remote's only head is nullid This fixes (issue2907) a crash when using 'hg incoming --bundle' with an empty remote repo and a non-empty local repo. This also fixes an unreported bug that 'hg summary --remote' erroneously reports incoming changes when the remote repo is empty and the local is not. Also, add a test to make sure issue2907 stays fixed
author Andrew Pritchard <andrewp@fogcreek.com>
date Wed, 27 Jul 2011 18:32:54 -0400
parents 308e1b5acc87
children c20688b7c061
line wrap: on
line diff
--- a/mercurial/setdiscovery.py	Thu Jul 28 14:36:07 2011 +0900
+++ b/mercurial/setdiscovery.py	Wed Jul 27 18:32:54 2011 -0400
@@ -190,4 +190,5 @@
             ui.warn(_("warning: repository is unrelated\n"))
         return (set([nullid]), True, srvheadhashes,)
 
-    return (dag.externalizeall(result), True, srvheadhashes,)
+    anyincoming = (srvheadhashes != [nullid])
+    return dag.externalizeall(result), anyincoming, srvheadhashes