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.
--- 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)