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