mercurial/localrepo.py
changeset 26748 5ba0a99ff27f
parent 26741 e1568d5eb052
child 26751 520defbc0335
equal deleted inserted replaced
26747:beff0b2481b3 26748:5ba0a99ff27f
   975             raise error.RepoError(
   975             raise error.RepoError(
   976                 _("abandoned transaction found"),
   976                 _("abandoned transaction found"),
   977                 hint=_("run 'hg recover' to clean up transaction"))
   977                 hint=_("run 'hg recover' to clean up transaction"))
   978 
   978 
   979         # make journal.dirstate contain in-memory changes at this point
   979         # make journal.dirstate contain in-memory changes at this point
   980         self.dirstate.write()
   980         self.dirstate.write(None)
   981 
   981 
   982         idbase = "%.40f#%f" % (random.random(), time.time())
   982         idbase = "%.40f#%f" % (random.random(), time.time())
   983         txnid = 'TXN:' + util.sha1(idbase).hexdigest()
   983         txnid = 'TXN:' + util.sha1(idbase).hexdigest()
   984         self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)
   984         self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)
   985 
   985 
  1003                 # this should be explicitly invoked here, because
  1003                 # this should be explicitly invoked here, because
  1004                 # in-memory changes aren't written out at closing
  1004                 # in-memory changes aren't written out at closing
  1005                 # transaction, if tr.addfilegenerator (via
  1005                 # transaction, if tr.addfilegenerator (via
  1006                 # dirstate.write or so) isn't invoked while
  1006                 # dirstate.write or so) isn't invoked while
  1007                 # transaction running
  1007                 # transaction running
  1008                 repo.dirstate.write()
  1008                 repo.dirstate.write(None)
  1009             else:
  1009             else:
  1010                 # prevent in-memory changes from being written out at
  1010                 # prevent in-memory changes from being written out at
  1011                 # the end of outer wlock scope or so
  1011                 # the end of outer wlock scope or so
  1012                 repo.dirstate.invalidate()
  1012                 repo.dirstate.invalidate()
  1013 
  1013 
  1317 
  1317 
  1318         def unlock():
  1318         def unlock():
  1319             if self.dirstate.pendingparentchange():
  1319             if self.dirstate.pendingparentchange():
  1320                 self.dirstate.invalidate()
  1320                 self.dirstate.invalidate()
  1321             else:
  1321             else:
  1322                 self.dirstate.write()
  1322                 self.dirstate.write(None)
  1323 
  1323 
  1324             self._filecache['dirstate'].refresh()
  1324             self._filecache['dirstate'].refresh()
  1325 
  1325 
  1326         l = self._lock(self.vfs, "wlock", wait, unlock,
  1326         l = self._lock(self.vfs, "wlock", wait, unlock,
  1327                        self.invalidatedirstate, _('working directory of %s') %
  1327                        self.invalidatedirstate, _('working directory of %s') %