Skip to content

Commit fa9af52

Browse files
committed
OTWO-1412 Initializes bzr properly and sets up logger.
If bzr logger is not set, warning messages generated by bzr get suppressed and an error is logged to stderr instead, telling us that logger is not initialized. This was causing bzr Sloc jobs to die or hang in some cases.
1 parent 3b24ee8 commit fa9af52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/scm/adapters/bzrlib/bzrlib_pipe_server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from bzrlib.branch import Branch
22
from bzrlib.revisionspec import RevisionSpec
3+
from cStringIO import StringIO
34
import sys
45
import time
56
import traceback
7+
import logging
68

79
class BzrPipeServer:
810
def __init__(self, repository_url):
@@ -88,6 +90,9 @@ def command_loop():
8890

8991
if __name__ == "__main__":
9092
try:
93+
stream = StringIO()
94+
handler = logging.StreamHandler(stream)
95+
logging.getLogger('bzr').addHandler(handler)
9196
command_loop()
9297
except:
9398
exc_trace = traceback.format_exc()

0 commit comments

Comments
 (0)