Mercurial > hg
comparison mercurial/setdiscovery.py @ 32768:483d47753726
setdiscovery: improves logged message
The 'srvheads' list contains all server heads including the common ones. We
adjust 'ui.log' message to provide more useful information about server heads
locally unknown. The performance impact of turning the list to set is
negligible (about 1e-4s) compared to the rest of the discovery cost, so I'm
taking the easy path.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 10 Jun 2017 18:47:09 +0100 |
parents | 28240b75e880 |
children | f77121b6bf1b |
comparison
equal
deleted
inserted
replaced
32767:e5dd44f78ac6 | 32768:483d47753726 |
---|---|
239 # return any heads in that case, so discard that | 239 # return any heads in that case, so discard that |
240 result.discard(nullrev) | 240 result.discard(nullrev) |
241 elapsed = util.timer() - start | 241 elapsed = util.timer() - start |
242 ui.progress(_('searching'), None) | 242 ui.progress(_('searching'), None) |
243 ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed)) | 243 ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed)) |
244 msg = 'found %d common and %d missing heads, %d roundtrips in %.4fs\n' | 244 msg = ('found %d common and %d unknown server heads,' |
245 ui.log('discovery', msg, len(result), len(srvheadhashes), roundtrips, | 245 ' %d roundtrips in %.4fs\n') |
246 missing = set(result) - set(srvheads) | |
247 ui.log('discovery', msg, len(result), len(missing), roundtrips, | |
246 elapsed) | 248 elapsed) |
247 | 249 |
248 if not result and srvheadhashes != [nullid]: | 250 if not result and srvheadhashes != [nullid]: |
249 if abortwhenunrelated: | 251 if abortwhenunrelated: |
250 raise error.Abort(_("repository is unrelated")) | 252 raise error.Abort(_("repository is unrelated")) |