# HG changeset patch # User David Soria Parra # Date 2013-10-01 10:20:29 # Node ID eddc2a2d57e6395eca2d6564192c45a863f03cab # Parent 57479e0d203d0006b09bf386f538424ca74d8509 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. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -813,7 +813,7 @@ class localrepository(object): 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 @@ class localrepository(object): 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)