Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revlog.py @ 50761:4a3a9d961561 stable
revlog: fix the naming scheme use by split temporary file
The `-s` is now added on the first piece only and the `.i` is added to the
index. This match the initially intended naming scheme.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 21 Jul 2023 15:50:56 +0200 |
parents | a41eeb877d07 |
children | 74c004a515bc d718eddf01d9 |
line wrap: on
line diff
--- a/mercurial/revlog.py Fri Jul 21 15:15:43 2023 +0200 +++ b/mercurial/revlog.py Fri Jul 21 15:50:56 2023 +0200 @@ -2131,11 +2131,14 @@ The file will only exist if a splitting operation is in progress, but it is always expected at the same location.""" - parts = os.path.split(self.radix) + parts = self.radix.split(b'/') if len(parts) > 1: # adds a '-s' prefix to the ``data/` or `meta/` base head = parts[0] + b'-s' - return os.path.join(head, *parts[1:]) + mids = parts[1:-1] + tail = parts[-1] + b'.i' + pieces = [head] + mids + [tail] + return b'/'.join(pieces) else: # the revlog is stored at the root of the store (changelog or # manifest), no risk of collision.