changeset 19853:eddc2a2d57e6

localrepo: make report level in repo.transaction configurable repo.transaction always writes to stderr when a transaction aborts. In order to be able to abort a transaction quietly (e.g shelve needs a temporary view on the repo) we need to make the report level configurable.
author David Soria Parra <dsp@experimentalworks.net>
date Tue, 01 Oct 2013 12:20:29 +0200
parents 57479e0d203d
children 49d4919d21c2
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Oct 01 17:00:03 2013 -0700
+++ b/mercurial/localrepo.py	Tue Oct 01 12:20:29 2013 +0200
@@ -813,7 +813,7 @@
     def wwritedata(self, filename, data):
         return self._filter(self._decodefilterpats, filename, data)
 
-    def transaction(self, desc):
+    def transaction(self, desc, report=None):
         tr = self._transref and self._transref() or None
         if tr and tr.running():
             return tr.nest()
@@ -825,8 +825,8 @@
 
         self._writejournal(desc)
         renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
-
-        tr = transaction.transaction(self.ui.warn, self.sopener,
+        rp = report and report or self.ui.warn
+        tr = transaction.transaction(rp, self.sopener,
                                      self.sjoin("journal"),
                                      aftertrans(renames),
                                      self.store.createmode)