[PATCH 3 of 3 topic-ext] topics: only apply topic to commits of the working copy

Matt Mackall mpm at selenic.com
Mon Jun 15 15:21:57 CDT 2015


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1434145786 18000
#      Fri Jun 12 16:49:46 2015 -0500
# Node ID 375b9ccb7f25fde4dcf2b61a29ff282396544abe
# Parent  97d0a52e26d801ba163e324e16aedb616a18a387
topics: only apply topic to commits of the working copy

diff -r 97d0a52e26d8 -r 375b9ccb7f25 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


More information about the Mercurial-devel mailing list