# HG changeset patch # User Pierre-Yves David # Date 1537614546 -7200 # Node ID 865c33c165080320e7a598ab2c936dc44ba82349 # Parent 23658110ab26a7a2123459fbf324a17e2bf436d3 topic: respect preexisting 'topic' value on workingcommitctx Mercurial's core changeset: 6c8ceebce309 revealed an issue. If the creator of a workingcommitctx explicitly assigned a 'topic', it was silently overridden by the current active on. This break import of patch with topic information. We now respect preexisting topic information. diff -r 23658110ab26 -r 865c33c16508 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Fri Sep 21 19:49:28 2018 +0200 +++ b/hgext3rd/topic/__init__.py Sat Sep 22 13:09:06 2018 +0200 @@ -553,11 +553,12 @@ def wrapinit(orig, self, repo, *args, **kwargs): orig(self, repo, *args, **kwargs) - 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 - self._extra[constants.extrakey] = '' + if constants.extrakey not in self._extra: + 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 + self._extra[constants.extrakey] = '' def wrapadd(orig, cl, manifest, files, desc, transaction, p1, p2, user, date=None, extra=None):