Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 50265:240a04cedd24
branch: pass current transaction when writing branch for transaction backup
This will requires more change soon (as we can simplify this backup). This will
be done in later changesets.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 02 Mar 2023 14:46:37 +0100 |
parents | 11e6eee4b063 |
children | f92afdf3cff9 |
comparison
equal
deleted
inserted
replaced
50264:921f4834b7b5 | 50265:240a04cedd24 |
---|---|
2673 # strip" to pick a working copy destination on `hg rollback` | 2673 # strip" to pick a working copy destination on `hg rollback` |
2674 if self.currentwlock() is not None: | 2674 if self.currentwlock() is not None: |
2675 ds = self.dirstate | 2675 ds = self.dirstate |
2676 if ds.branch() == b'default': | 2676 if ds.branch() == b'default': |
2677 # force a file to be written if None exist | 2677 # force a file to be written if None exist |
2678 ds.setbranch(b'default') | 2678 ds.setbranch(b'default', None) |
2679 # we cannot simply add "branch" to `all_file_names` because branch | 2679 # we cannot simply add "branch" to `all_file_names` because branch |
2680 # is written outside of the transaction control. So we need to | 2680 # is written outside of the transaction control. So we need to |
2681 # backup early. | 2681 # backup early. |
2682 tr.addbackup(b"branch", hardlink=True, location=b'plain') | 2682 tr.addbackup(b"branch", hardlink=True, location=b'plain') |
2683 | 2683 |