# HG changeset patch # User Gregory Szorc # Date 2018-09-17 23:19:55 # Node ID 4024c363cd33a473e27482ff91ab763787ca4258 # Parent 1a68c9b1920d2922c8076ea01e8574134235231d transaction: make names a private attribute This is used to report the transaction name in __repr__. It is very obviously an implementation detail and doesn't need to be exposed as part of the public interface. So mark it as private. Differential Revision: https://phab.mercurial-scm.org/D4633 diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -149,7 +149,7 @@ class transaction(util.transactional): if checkambigfiles: self._checkambigfiles.update(checkambigfiles) - self.names = [name] + self._names = [name] # A dict dedicated to precisely tracking the changes introduced in the # transaction. @@ -189,7 +189,7 @@ class transaction(util.transactional): self._abortcallback = {} def __repr__(self): - name = r'/'.join(self.names) + name = r'/'.join(self._names) return (r'' % (name, self._count, self._usages)) @@ -375,14 +375,14 @@ class transaction(util.transactional): def nest(self, name=r''): self._count += 1 self._usages += 1 - self.names.append(name) + self._names.append(name) return self def release(self): if self._count > 0: self._usages -= 1 - if self.names: - self.names.pop() + if self._names: + self._names.pop() # if the transaction scopes are left without being closed, fail if self._count > 0 and self._usages == 0: self._abort()