aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/storage')
-rw-r--r--libbe/storage/vcs/hg.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/libbe/storage/vcs/hg.py b/libbe/storage/vcs/hg.py
index acf391d..b61e796 100644
--- a/libbe/storage/vcs/hg.py
+++ b/libbe/storage/vcs/hg.py
@@ -83,10 +83,16 @@ class Hg(base.VCS):
assert len(kwargs) == 1, kwargs
fullargs = ['--cwd', kwargs['cwd']]
fullargs.extend(args)
- output = StringIO.StringIO()
cwd = os.getcwd()
- req = mercurial.dispatch.request(fullargs, fout=output)
- mercurial.dispatch.dispatch(req)
+ output = StringIO.StringIO()
+ if self.version_cmp(1,9):
+ req = mercurial.dispatch.request(fullargs, fout=output)
+ mercurial.dispatch.dispatch(req)
+ else:
+ stdout = sys.stdout
+ sys.stdout = output
+ mercurial.dispatch.dispatch(fullargs)
+ sys.stdout = stdout
os.chdir(cwd)
return output.getvalue().rstrip('\n')