# HG changeset patch # User Gregory Szorc # Date 1537226395 25200 # 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 -r 1a68c9b1920d -r 4024c363cd33 mercurial/transaction.py --- a/mercurial/transaction.py Mon Sep 17 16:13:38 2018 -0700 +++ b/mercurial/transaction.py Mon Sep 17 16:19:55 2018 -0700 @@ -149,7 +149,7 @@ 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 @@ 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 @@ 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()