diff -r 892806b3fc0f mercurial/filelog.py
--- a/mercurial/filelog.py      Sun Aug 10 22:55:00 2008 -0500
+++ b/mercurial/filelog.py      Fri Aug 22 17:10:09 2008 +0200
@@ -46,6 +46,13 @@
             m[k] = v
         return m

+    def _hasmeta(self, node):
+        t = self.revision(node)
+        if not t.startswith('\1\n'):
+            return False
+        else:
+            return True
+
     def add(self, text, meta, transaction, link, p1=None, p2=None):
         if meta or text.startswith('\1\n'):
             mt = ""
@@ -65,9 +72,9 @@
     def size(self, rev):
         """return the size of a given revision"""

-        # for revisions with renames, we have to go the slow way
+        # for revisions with metadata, we have to go the slow way
         node = self.node(rev)
-        if self.renamed(node):
+        if self._hasmeta(node):
             return len(self.read(node))

         return revlog.size(self, rev)
@@ -75,8 +82,8 @@
     def cmp(self, node, text):
         """compare text with a given file revision"""

-        # for renames, we have to go the slow way
-        if self.renamed(node):
+        # for metadata, we have to go the slow way
+        if self._hasmeta(node):
             t2 = self.read(node)
             return t2 != text

diff -r 892806b3fc0f mercurial/localrepo.py
--- a/mercurial/localrepo.py    Sun Aug 10 22:55:00 2008 -0500
+++ b/mercurial/localrepo.py    Fri Aug 22 17:10:09 2008 +0200
@@ -680,7 +680,7 @@
         self._wlockref = weakref.ref(l)
         return l

-    def filecommit(self, fn, manifest1, manifest2, linkrev, tr, changelist):
+    def filecommit(self, fn, manifest1, manifest2, linkrev, tr, changelist, metadata=None):
         """
         commit an individual file as part of a larger transaction
         """
@@ -690,7 +690,7 @@
         fp1 = manifest1.get(fn, nullid)
         fp2 = manifest2.get(fn, nullid)

-        meta = {}
+        meta = metadata or {}
         cf = self.dirstate.copied(fn)
         if cf and cf != fn:
             # Mark the new revision of this file as a copy of another
@@ -766,7 +766,7 @@

     def commit(self, files=None, text="", user=None, date=None,
                match=util.always, force=False, force_editor=False,
-               p1=None, p2=None, extra={}, empty_ok=False):
+               p1=None, p2=None, extra={}, files_meta={}, empty_ok=False):
         wlock = lock = tr = None
         valid = 0 # don't save the dirstate if this isn't set
         if files:
@@ -849,7 +849,8 @@
             for f in commit:
                 self.ui.note(f + "\n")
                 try:
-                    new[f] = self.filecommit(f, m1, m2, linkrev, trp, changed)
+                    metadata = files_meta.get(f)
+                    new[f] = self.filecommit(f, m1, m2, linkrev, trp, changed, metadata)
                     new_exec = is_exec(f)
                     new_link = is_link(f)
                     if ((not changed or changed[-1] != f) and
