mercurial/localrepo.py
changeset 24394 03163826b4e6
parent 24388 026f8af88e49
child 24402 c2287f203ec4
equal deleted inserted replaced
24393:77eace2a63cb 24394:03163826b4e6
  1230         """
  1230         """
  1231         commit an individual file as part of a larger transaction
  1231         commit an individual file as part of a larger transaction
  1232         """
  1232         """
  1233 
  1233 
  1234         fname = fctx.path()
  1234         fname = fctx.path()
  1235         text = fctx.data()
       
  1236         flog = self.file(fname)
       
  1237         fparent1 = manifest1.get(fname, nullid)
  1235         fparent1 = manifest1.get(fname, nullid)
  1238         fparent2 = manifest2.get(fname, nullid)
  1236         fparent2 = manifest2.get(fname, nullid)
  1239 
  1237         if isinstance(fctx, context.filectx):
       
  1238             node = fctx.filenode()
       
  1239             if node in [fparent1, fparent2]:
       
  1240                 self.ui.debug('reusing %s filelog entry\n' % fname)
       
  1241                 return node
       
  1242 
       
  1243         flog = self.file(fname)
  1240         meta = {}
  1244         meta = {}
  1241         copy = fctx.renamed()
  1245         copy = fctx.renamed()
  1242         if copy and copy[0] != fname:
  1246         if copy and copy[0] != fname:
  1243             # Mark the new revision of this file as a copy of another
  1247             # Mark the new revision of this file as a copy of another
  1244             # file.  This copy data will effectively act as a parent
  1248             # file.  This copy data will effectively act as a parent
  1296                 fparent1, fparent2 = fparent2, nullid
  1300                 fparent1, fparent2 = fparent2, nullid
  1297             elif fparent2 in fparentancestors:
  1301             elif fparent2 in fparentancestors:
  1298                 fparent2 = nullid
  1302                 fparent2 = nullid
  1299 
  1303 
  1300         # is the file changed?
  1304         # is the file changed?
       
  1305         text = fctx.data()
  1301         if fparent2 != nullid or flog.cmp(fparent1, text) or meta:
  1306         if fparent2 != nullid or flog.cmp(fparent1, text) or meta:
  1302             changelist.append(fname)
  1307             changelist.append(fname)
  1303             return flog.add(text, meta, tr, linkrev, fparent1, fparent2)
  1308             return flog.add(text, meta, tr, linkrev, fparent1, fparent2)
  1304         # are just the flags changed during merge?
  1309         # are just the flags changed during merge?
  1305         elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():
  1310         elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():