mercurial/store.py
changeset 26587 56b2bcea2529
parent 25660 328739ea70c3
child 26778 a95c975f42e3
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
     4 #
     4 #
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from i18n import _
     8 from i18n import _
     9 import scmutil, util, parsers
     9 import scmutil, util, parsers, error
    10 import os, stat, errno
    10 import os, stat, errno
    11 
    11 
    12 _sha = util.sha1
    12 _sha = util.sha1
    13 
    13 
    14 # This avoids a collision between a file named foo and a dir named
    14 # This avoids a collision between a file named foo and a dir named
   403         if '' in self.entries:
   403         if '' in self.entries:
   404             fp.seek(0)
   404             fp.seek(0)
   405             for n, line in enumerate(fp):
   405             for n, line in enumerate(fp):
   406                 if not line.rstrip('\n'):
   406                 if not line.rstrip('\n'):
   407                     t = _('invalid entry in fncache, line %s') % (n + 1)
   407                     t = _('invalid entry in fncache, line %s') % (n + 1)
   408                     raise util.Abort(t)
   408                     raise error.Abort(t)
   409         fp.close()
   409         fp.close()
   410 
   410 
   411     def write(self, tr):
   411     def write(self, tr):
   412         if self._dirty:
   412         if self._dirty:
   413             tr.addbackup('fncache')
   413             tr.addbackup('fncache')