Mercurial > hg
comparison mercurial/store.py @ 42325:526750cdd02d
bookmarks: keep bookmarks in .hg/store if new config set
Bookmarks storage consists of two parts: (1) the set of bookmarks and
their positions, and (2) the current bookmark. The former can get
updated by exchange, while the latter cannot. However, they are both
stored in directly .hg/ and protected by repo.wlock(). As a result,
ugly workarounds were needed. This patch introduces a new config
option to store the set of bookmarks and their positions in .hg/store/
but still storing the current bookmark directory in .hg/. The config
option only takes effect at repo creation time. It results in a new
requirement being set.
Differential Revision: https://phab.mercurial-scm.org/D6387
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 15 May 2019 22:09:02 -0700 |
parents | 3e7cfa17df5d |
children | 27d6956d386b |
comparison
equal
deleted
inserted
replaced
42319:b162229ebe0d | 42325:526750cdd02d |
---|---|
335 mode = None | 335 mode = None |
336 except OSError: | 336 except OSError: |
337 mode = None | 337 mode = None |
338 return mode | 338 return mode |
339 | 339 |
340 _data = ('narrowspec data meta 00manifest.d 00manifest.i' | 340 _data = ('bookmarks narrowspec data meta 00manifest.d 00manifest.i' |
341 ' 00changelog.d 00changelog.i phaseroots obsstore') | 341 ' 00changelog.d 00changelog.i phaseroots obsstore') |
342 | 342 |
343 def isrevlog(f, kind, st): | 343 def isrevlog(f, kind, st): |
344 return kind == stat.S_IFREG and f[-2:] in ('.i', '.d') | 344 return kind == stat.S_IFREG and f[-2:] in ('.i', '.d') |
345 | 345 |
610 except OSError as err: | 610 except OSError as err: |
611 if err.errno != errno.ENOENT: | 611 if err.errno != errno.ENOENT: |
612 raise | 612 raise |
613 | 613 |
614 def copylist(self): | 614 def copylist(self): |
615 d = ('narrowspec data meta dh fncache phaseroots obsstore' | 615 d = ('bookmarks narrowspec data meta dh fncache phaseroots obsstore' |
616 ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i') | 616 ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i') |
617 return (['requires', '00changelog.i'] + | 617 return (['requires', '00changelog.i'] + |
618 ['store/' + f for f in d.split()]) | 618 ['store/' + f for f in d.split()]) |
619 | 619 |
620 def write(self, tr): | 620 def write(self, tr): |