# HG changeset patch # User Martin von Zweigbergk # Date 2017-06-12 23:35:57 # Node ID e65ff29dbeb02ce08e4a64f381ccd37949354dcf # Parent 9b7d615108d77d885d54a6b8709419485dfc8cbd pushkey: use False/True for return values from push functions It was particularly unclear in phases.pushphase() whether the 0/1 returned were the 0/1 for public/draft phase or for False/True diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -944,10 +944,10 @@ def pushmarker(repo, key, old, new): """Push markers over pushkey""" if not key.startswith('dump'): repo.ui.warn(_('unknown key: %r') % key) - return 0 + return False if old: repo.ui.warn(_('unexpected old value for %r') % key) - return 0 + return False data = util.b85decode(new) lock = repo.lock() try: @@ -956,7 +956,7 @@ def pushmarker(repo, key, old, new): repo.obsstore.mergemarkers(tr, data) repo.invalidatevolatilesets() tr.close() - return 1 + return True finally: tr.release() finally: diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -423,12 +423,12 @@ def pushphase(repo, nhex, oldphasestr, n if currentphase == oldphase and newphase < oldphase: with repo.transaction('pushkey-phase') as tr: advanceboundary(repo, tr, newphase, [bin(nhex)]) - return 1 + return True elif currentphase == newphase: # raced, but got correct result - return 1 + return True else: - return 0 + return False def analyzeremotephases(repo, subset, roots): """Compute phases heads and root in a subset of node from root dict