mercurial/filelog.py
changeset 40005 1d97a332c6d9
parent 40002 0e8836be9541
child 40006 422beffd71ba
equal deleted inserted replaced
40004:fa3dc85a747e 40005:1d97a332c6d9
   113         if meta or text.startswith('\1\n'):
   113         if meta or text.startswith('\1\n'):
   114             text = storageutil.packmeta(meta, text)
   114             text = storageutil.packmeta(meta, text)
   115         return self.addrevision(text, transaction, link, p1, p2)
   115         return self.addrevision(text, transaction, link, p1, p2)
   116 
   116 
   117     def renamed(self, node):
   117     def renamed(self, node):
   118         if self.parents(node)[0] != revlog.nullid:
   118         return storageutil.filerevisioncopied(self, node)
   119             return False
       
   120         t = self.revision(node)
       
   121         m = storageutil.parsemeta(t)[0]
       
   122         # copy and copyrev occur in pairs. In rare cases due to bugs,
       
   123         # one can occur without the other.
       
   124         if m and "copy" in m and "copyrev" in m:
       
   125             return (m["copy"], revlog.bin(m["copyrev"]))
       
   126         return False
       
   127 
   119 
   128     def size(self, rev):
   120     def size(self, rev):
   129         """return the size of a given revision"""
   121         """return the size of a given revision"""
   130 
   122 
   131         # for revisions with renames, we have to go the slow way
   123         # for revisions with renames, we have to go the slow way