comparison hgext3rd/topic/__init__.py @ 2897:bd04a614b866

topic: move a status message in the right scope The finally get runs on failure so we should not advertise rewrite topic in the case. In addition the 'rewrote' variable can be undefined in the finally.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Sep 2017 17:37:47 +0200
parents 1e3d97486861
children 3dfc88c06378
comparison
equal deleted inserted replaced
2896:462adae9fea7 2897:bd04a614b866
386 wl = repo.wlock() 386 wl = repo.wlock()
387 l = repo.lock() 387 l = repo.lock()
388 txn = repo.transaction('rewrite-topics') 388 txn = repo.transaction('rewrite-topics')
389 rewrote = _changetopics(ui, repo, rev, topic) 389 rewrote = _changetopics(ui, repo, rev, topic)
390 txn.close() 390 txn.close()
391 ui.status('changed topic on %d changes\n' % rewrote)
391 finally: 392 finally:
392 lockmod.release(txn, l, wl) 393 lockmod.release(txn, l, wl)
393 repo.invalidate() 394 repo.invalidate()
394 ui.status('changed topic on %d changes\n' % rewrote)
395 return 395 return
396 396
397 if clear: 397 if clear:
398 return _changecurrenttopic(repo, None) 398 return _changecurrenttopic(repo, None)
399 399