transaction: work around and document issue with file backup
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 01 Oct 2014 21:40:44 -0500
changeset 22662 c4d63f6740b8
parent 22661 9ea2913e7c41
child 22663 4c6198737ad8
transaction: work around and document issue with file backup The backup restoration is actually hard-coded for the main file. And this hard-coded list is the only one used when repairing an interrupted transaction from another process. Solving this problem is out of the scope of this series so we document it and work around its implications.
mercurial/transaction.py
--- a/mercurial/transaction.py	Thu Oct 02 00:15:15 2014 -0500
+++ b/mercurial/transaction.py	Wed Oct 01 21:40:44 2014 -0500
@@ -243,7 +243,11 @@
             files = []
             try:
                 for name in filenames:
-                    self.addbackup(name)
+                    # Some files are already backed up when creating the
+                    # localrepo. Until this is properly fixed we disable the
+                    # backup for them.
+                    if name not in ('phaseroots',):
+                        self.addbackup(name)
                     files.append(self.opener(name, 'w', atomictemp=True))
                 genfunc(*files)
             finally: