[gerrit-client.py] Fix DeprecationWarnings in mass-abandon

Fixes

    .../gerrit_client.py:424: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
      logging.warn("%s CLs match search query: " % len(result))
    WARNING:root:100 CLs match search query:
    .../gerrit_client.py:426: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
      logging.warn("[ID: %d] %s" % (change['_number'], change['subject']))

when using `gerrit_client.py mass-abandon`.

Also fixes other `logging.warn()` instances in the same method.

No behavior change.

Bug: none
Change-Id: Ib382d78aca18885ad3c8c0a97631dc76ef7cb22d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4631658
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
changes/58/4631658/2
Nico Weber 2 years ago committed by LUCI CQ
parent 2e6738447e
commit 6b33f85fb9

@ -442,18 +442,18 @@ def CMDmass_abandon(parser, args):
limit=100,
)
if len(result) == 0:
logging.warn("Nothing to abandon")
logging.warning("Nothing to abandon")
return
logging.warn("%s CLs match search query: " % len(result))
logging.warning("%s CLs match search query: " % len(result))
for change in result:
logging.warn("[ID: %d] %s" % (change['_number'], change['subject']))
logging.warning("[ID: %d] %s" % (change['_number'], change['subject']))
if not opt.force:
q = input(
'Do you want to move forward with abandoning? [y to confirm] ').strip()
if q not in ['y', 'Y']:
logging.warn("Aborting...")
logging.warning("Aborting...")
return
for change in result:

Loading…
Cancel
Save