Patchwork [2,of,5,RFC] patchbomb: look for non-empty publicurl, not a non-None one

login
register
mail settings
Submitter Augie Fackler
Date June 13, 2017, 10:12 p.m.
Message ID <c33d1593d5d60468b026.1497391957@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/21366/
State Accepted
Headers show

Comments

Augie Fackler - June 13, 2017, 10:12 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# 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.

Patch

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)