D4623: transaction: make undoname a private attribute

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Tue Sep 18 17:29:00 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGda9ce63bfa9b: transaction: make undoname a private attribute (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4623?vs=11122&id=11149

REVISION DETAIL
  https://phab.mercurial-scm.org/D4623

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -132,7 +132,7 @@
         self.entries = []
         self.map = {}
         self.journal = journalname
-        self.undoname = undoname
+        self._undoname = undoname
         self._queue = []
         # A callback to validate transaction content before closing it.
         # should raise exception is anything is wrong.
@@ -532,9 +532,10 @@
 
     def _writeundo(self):
         """write transaction data for possible future undo call"""
-        if self.undoname is None:
+        if self._undoname is None:
             return
-        undobackupfile = self.opener.open("%s.backupfiles" % self.undoname, 'w')
+        undobackupfile = self.opener.open("%s.backupfiles" % self._undoname,
+                                          'w')
         undobackupfile.write('%d\n' % version)
         for l, f, b, c in self._backupentries:
             if not f:  # temporary file
@@ -549,7 +550,7 @@
                 vfs = self._vfsmap[l]
                 base, name = vfs.split(b)
                 assert name.startswith(self.journal), name
-                uname = name.replace(self.journal, self.undoname, 1)
+                uname = name.replace(self.journal, self._undoname, 1)
                 u = vfs.reljoin(base, uname)
                 util.copyfile(vfs.join(b), vfs.join(u), hardlink=True)
             undobackupfile.write("%s\0%s\0%s\0%d\n" % (l, f, u, c))



To: indygreg, #hg-reviewers
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list