No keyword substitution in cmp(); no overriding of size() ATM solo-extension
authorChristian Ebert <blacktrash@gmx.net>
Sun, 07 Jan 2007 21:51:57 +0100
branchsolo-extension
changeset 71 f7a2a246740c
parent 70 f5818ce4c2bd
child 72 28455872cb0e
No keyword substitution in cmp(); no overriding of size() ATM This hopefully solves the merge/no conflict issue brought up by Boris Samorodov in Message-ID: <12807831@srv.sem.ipt.ru>.
hgkw/keyword.py
--- a/hgkw/keyword.py	Sat Jan 06 14:35:24 2007 +0100
+++ b/hgkw/keyword.py	Sun Jan 07 21:51:57 2007 +0100
@@ -246,7 +246,6 @@
                 self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2)
                 return n
 
-    
     class kwfilelog(filelog.filelog):
         def __init__(self, opener, path, repo,
                      defversion=revlog.REVLOG_DEFAULT_VERSION):
@@ -264,18 +263,11 @@
                             fileid=node, filelog=self), data)
             return data
 
-        def size(self, rev):
-            '''Overrides filelog's size() to use kwfilelog.read().'''
-            node = revlog.node(self, rev)
-            if super(kwfilelog, self).renamed(node):
-                return len(self.read(node))
-            return revlog.size(self, rev)
-
         def cmp(self, node, text):
-            '''Overrides filelog's cmp() to use kwfilelog.read().'''
-            if super(kwfilelog, self).renamed(node):
-                t2 = self.read(node)
-                return t2 != text
+            '''Removes keyword substitution for comparison.'''
+            if not util.binary(text):
+                text = re_kw.sub(r'$\1$', text)
+            return super(kwfilelog, self).cmp(node, text)
 
     filelog.filelog = kwfilelog
     repo.__class__ = kwrepo