##// END OF EJS Templates
journal: rename on disk files to 'namejournal'...
Pierre-Yves David -
r29870:6d11ae3c default
parent child Browse files
Show More
@@ -162,12 +162,12 b' def unsharejournal(orig, ui, repo, repop'
162 # there is a shared repository and there are shared journal entries
162 # there is a shared repository and there are shared journal entries
163 # to copy. move shared date over from source to destination but
163 # to copy. move shared date over from source to destination but
164 # move the local file first
164 # move the local file first
165 if repo.vfs.exists('journal'):
165 if repo.vfs.exists('namejournal'):
166 journalpath = repo.join('journal')
166 journalpath = repo.join('namejournal')
167 util.rename(journalpath, journalpath + '.bak')
167 util.rename(journalpath, journalpath + '.bak')
168 storage = repo.journal
168 storage = repo.journal
169 local = storage._open(
169 local = storage._open(
170 repo.vfs, filename='journal.bak', _newestfirst=False)
170 repo.vfs, filename='namejournal.bak', _newestfirst=False)
171 shared = (
171 shared = (
172 e for e in storage._open(sharedrepo.vfs, _newestfirst=False)
172 e for e in storage._open(sharedrepo.vfs, _newestfirst=False)
173 if sharednamespaces.get(e.namespace) in sharedfeatures)
173 if sharednamespaces.get(e.namespace) in sharedfeatures)
@@ -273,13 +273,13 b' class journalstorage(object):'
273 raise error.Abort(_('journal lock does not support nesting'))
273 raise error.Abort(_('journal lock does not support nesting'))
274 desc = _('journal of %s') % vfs.base
274 desc = _('journal of %s') % vfs.base
275 try:
275 try:
276 l = lock.lock(vfs, 'journal.lock', 0, desc=desc)
276 l = lock.lock(vfs, 'namejournal.lock', 0, desc=desc)
277 except error.LockHeld as inst:
277 except error.LockHeld as inst:
278 self.ui.warn(
278 self.ui.warn(
279 _("waiting for lock on %s held by %r\n") % (desc, inst.locker))
279 _("waiting for lock on %s held by %r\n") % (desc, inst.locker))
280 # default to 600 seconds timeout
280 # default to 600 seconds timeout
281 l = lock.lock(
281 l = lock.lock(
282 vfs, 'journal.lock',
282 vfs, 'namejournal.lock',
283 int(self.ui.config("ui", "timeout", "600")), desc=desc)
283 int(self.ui.config("ui", "timeout", "600")), desc=desc)
284 self.ui.warn(_("got lock after %s seconds\n") % l.delay)
284 self.ui.warn(_("got lock after %s seconds\n") % l.delay)
285 self._lockref = weakref.ref(l)
285 self._lockref = weakref.ref(l)
@@ -319,7 +319,7 b' class journalstorage(object):'
319 with self.jlock(vfs):
319 with self.jlock(vfs):
320 version = None
320 version = None
321 # open file in amend mode to ensure it is created if missing
321 # open file in amend mode to ensure it is created if missing
322 with vfs('journal', mode='a+b', atomictemp=True) as f:
322 with vfs('namejournal', mode='a+b', atomictemp=True) as f:
323 f.seek(0, os.SEEK_SET)
323 f.seek(0, os.SEEK_SET)
324 # Read just enough bytes to get a version number (up to 2
324 # Read just enough bytes to get a version number (up to 2
325 # digits plus separator)
325 # digits plus separator)
@@ -377,7 +377,7 b' class journalstorage(object):'
377 if sharednamespaces.get(e.namespace) in self.sharedfeatures)
377 if sharednamespaces.get(e.namespace) in self.sharedfeatures)
378 return _mergeentriesiter(local, shared)
378 return _mergeentriesiter(local, shared)
379
379
380 def _open(self, vfs, filename='journal', _newestfirst=True):
380 def _open(self, vfs, filename='namejournal', _newestfirst=True):
381 if not vfs.exists(filename):
381 if not vfs.exists(filename):
382 return
382 return
383
383
@@ -232,7 +232,7 b' Test that verbose, JSON, template and co'
232
232
233 Test for behaviour on unexpected storage version information
233 Test for behaviour on unexpected storage version information
234
234
235 $ printf '42\0' > .hg/journal
235 $ printf '42\0' > .hg/namejournal
236 $ hg journal
236 $ hg journal
237 previous locations of '.':
237 previous locations of '.':
238 abort: unknown journal file version '42'
238 abort: unknown journal file version '42'
General Comments 0
You need to be logged in to leave comments. Login now