From patchwork Tue Jun 13 22:12:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 5, RFC] patchbomb: look for non-empty publicurl, not a non-None one From: Augie Fackler X-Patchwork-Id: 21366 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 13 Jun 2017 18:12:37 -0400 # HG changeset patch # User Augie Fackler # Date 1497385850 14400 # Tue Jun 13 16:30:50 2017 -0400 # Node ID c33d1593d5d60468b0260d554311278746f50506 # Parent 08a51970530c7a55f6dada59cb82a2e4416ea05e patchbomb: look for non-empty publicurl, not a non-None one Otherwise it's impossible to turn this feature back off, which is making writing of tests awkward. diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -113,7 +113,7 @@ def _addpullheader(seq, ctx): # waiting for some logic that check that the changeset are available on the # destination before patchbombing anything. publicurl = repo.ui.config('patchbomb', 'publicurl') - if publicurl is not None: + if publicurl: return ('Available At %s\n' '# hg pull %s -r %s' % (publicurl, publicurl, ctx)) return None @@ -588,7 +588,7 @@ def email(ui, repo, *revs, **opts): # check if revision exist on the public destination publicurl = repo.ui.config('patchbomb', 'publicurl') - if publicurl is not None: + if publicurl: repo.ui.debug('checking that revision exist in the public repo') try: publicpeer = hg.peer(repo, {}, publicurl)