Show More
@@ -1765,16 +1765,12 b' class dirstate:' | |||||
1765 |
|
1765 | |||
1766 | This is only used to do `hg rollback` related backup in the transaction |
|
1766 | This is only used to do `hg rollback` related backup in the transaction | |
1767 | """ |
|
1767 | """ | |
1768 | if not self._opener.exists(self._filename): |
|
1768 | files = [b'branch'] | |
1769 | # no data every written to disk yet |
|
1769 | if self._opener.exists(self._filename): | |
1770 | return () |
|
1770 | files.append(self._filename) | |
1771 |
|
|
1771 | if self._use_dirstate_v2: | |
1772 | return ( |
|
1772 | files.append(self._map.docket.data_filename()) | |
1773 | self._filename, |
|
1773 | return tuple(files) | |
1774 | self._map.docket.data_filename(), |
|
|||
1775 | ) |
|
|||
1776 | else: |
|
|||
1777 | return (self._filename,) |
|
|||
1778 |
|
1774 | |||
1779 | def verify(self, m1, m2, p1, narrow_matcher=None): |
|
1775 | def verify(self, m1, m2, p1, narrow_matcher=None): | |
1780 | """ |
|
1776 | """ |
@@ -2673,13 +2673,9 b' class localrepository:' | |||||
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 not self.vfs.exists(b'branch'): | |
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', None) |
|
2678 | ds.setbranch(b'default', None) | |
2679 | # we cannot simply add "branch" to `all_file_names` because branch |
|
|||
2680 | # is written outside of the transaction control. So we need to |
|
|||
2681 | # backup early. |
|
|||
2682 | tr.addbackup(b"branch", hardlink=True, location=b'plain') |
|
|||
2683 |
|
2679 | |||
2684 | def backup_dirstate(tr): |
|
2680 | def backup_dirstate(tr): | |
2685 | for f in ds.all_file_names(): |
|
2681 | for f in ds.all_file_names(): |
General Comments 0
You need to be logged in to leave comments.
Login now