# HG changeset patch # User Pierre-Yves David # Date 1512478384 -3600 # Node ID 873d2f1949e19bc7ce135661a4e78c18321e24dd # Parent 5dfe4e5cf9e4790692feda0beeec113217a39092 topic: use more protective code to access current topic There are some code path where the operation is not properly initialized and lack the new attributes. While the lack of initialization, is suspicious and I've not be able to pin point case where this happens. Currently the code crash when it encounter this situation. So we make the code more resistant to this case to prevent bad user experience. diff -r 5dfe4e5cf9e4 -r 873d2f1949e1 CHANGELOG --- a/CHANGELOG Tue Dec 05 13:21:57 2017 +0100 +++ b/CHANGELOG Tue Dec 05 13:53:04 2017 +0100 @@ -1,6 +1,13 @@ Changelog ========= +7.0.2 - in progress +------------------- + +Topic (0.5.2) + + * makes code more resilient to partiel initialization + 7.0.1 -- 2017-11-14 ------------------- diff -r 5dfe4e5cf9e4 -r 873d2f1949e1 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Tue Dec 05 13:21:57 2017 +0100 +++ b/hgext3rd/topic/__init__.py Tue Dec 05 13:53:04 2017 +0100 @@ -474,7 +474,7 @@ def wrapinit(orig, self, repo, *args, **kwargs): orig(self, repo, *args, **kwargs) - if repo.currenttopic: + if getattr(repo, 'currenttopic', ''): self._extra[constants.extrakey] = repo.currenttopic else: # Empty key will be dropped from extra by another hack at the changegroup level @@ -1012,7 +1012,7 @@ return topicstime def summaryhook(ui, repo): - t = repo.currenttopic + t = getattr(repo, 'currenttopic', '') if not t: return # i18n: column positioning for "hg summary"