topics: only apply topic to commits of the working copy
authorMatt Mackall <mpm@selenic.com>
Fri, 12 Jun 2015 16:49:46 -0500
changeset 1855 f241a00e93a7
parent 1854 67950fcf1c69
child 1856 7d7f5f9e2f8c
topics: only apply topic to commits of the working copy
src/topic/__init__.py
--- a/src/topic/__init__.py	Fri Jun 12 16:41:10 2015 -0500
+++ b/src/topic/__init__.py	Fri Jun 12 16:49:46 2015 -0500
@@ -44,9 +44,10 @@
     orig = repo.__class__
     class topicrepo(repo.__class__):
         def commitctx(self, ctx, error=None):
-            current = self.currenttopic
-            if current:
-                ctx.extra()[constants.extrakey] = current
+            if isinstance(ctx, context.workingcommitctx):
+                current = self.currenttopic
+                if current:
+                    ctx.extra()[constants.extrakey] = current
             return orig.commitctx(self, ctx, error=error)
 
         @property