Mercurial > public > mercurial-scm > hg-stable
comparison hgext/patchbomb.py @ 32844:16ff5c6066a6
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.
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 13 Jun 2017 16:30:50 -0400 |
parents | d3b2d4587e73 |
children | 3abba5bc3454 |
comparison
equal
deleted
inserted
replaced
32843:d3b2d4587e73 | 32844:16ff5c6066a6 |
---|---|
111 repo = ctx.repo() | 111 repo = ctx.repo() |
112 # experimental config: patchbomb.publicurl | 112 # experimental config: patchbomb.publicurl |
113 # waiting for some logic that check that the changeset are available on the | 113 # waiting for some logic that check that the changeset are available on the |
114 # destination before patchbombing anything. | 114 # destination before patchbombing anything. |
115 publicurl = repo.ui.config('patchbomb', 'publicurl') | 115 publicurl = repo.ui.config('patchbomb', 'publicurl') |
116 if publicurl is not None: | 116 if publicurl: |
117 return ('Available At %s\n' | 117 return ('Available At %s\n' |
118 '# hg pull %s -r %s' % (publicurl, publicurl, ctx)) | 118 '# hg pull %s -r %s' % (publicurl, publicurl, ctx)) |
119 return None | 119 return None |
120 | 120 |
121 def uisetup(ui): | 121 def uisetup(ui): |
586 if bundle: | 586 if bundle: |
587 opts['revs'] = [str(r) for r in revs] | 587 opts['revs'] = [str(r) for r in revs] |
588 | 588 |
589 # check if revision exist on the public destination | 589 # check if revision exist on the public destination |
590 publicurl = repo.ui.config('patchbomb', 'publicurl') | 590 publicurl = repo.ui.config('patchbomb', 'publicurl') |
591 if publicurl is not None: | 591 if publicurl: |
592 repo.ui.debug('checking that revision exist in the public repo') | 592 repo.ui.debug('checking that revision exist in the public repo') |
593 try: | 593 try: |
594 publicpeer = hg.peer(repo, {}, publicurl) | 594 publicpeer = hg.peer(repo, {}, publicurl) |
595 except error.RepoError: | 595 except error.RepoError: |
596 repo.ui.write_err(_('unable to access public repo: %s\n') | 596 repo.ui.write_err(_('unable to access public repo: %s\n') |