changeset 1855:f241a00e93a7

topics: only apply topic to commits of the working copy
author Matt Mackall <mpm@selenic.com>
date Fri, 12 Jun 2015 16:49:46 -0500
parents 67950fcf1c69
children 7d7f5f9e2f8c
files src/topic/__init__.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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