aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo/commands/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'MgaRepo/commands/log.py')
-rw-r--r--MgaRepo/commands/log.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/MgaRepo/commands/log.py b/MgaRepo/commands/log.py
index 2181125..330a96a 100644
--- a/MgaRepo/commands/log.py
+++ b/MgaRepo/commands/log.py
@@ -6,6 +6,8 @@ from MgaRepo.rpmutil import sync
from MgaRepo.util import execcmd
import sys
import os
+import subprocess
+import shlex
HELP = """\
Usage: mgarepo log [OPTIONS] [PACKAGE]
@@ -57,9 +59,13 @@ def svn_log(pkgdirurl, verbose=False, limit=None, revision=None, releases=None):
args.append("-r")
args.append(revision)
if os.isatty(sys.stdin.fileno()):
- args.append("| less")
- rawcmd = " ".join(args)
- execcmd(rawcmd, show=True)
+ pager = shlex.split(os.environ.get("PAGER", "less"))
+ p = subprocess.Popen(args, stdout=subprocess.PIPE)
+ p2 = subprocess.Popen(pager, stdin=p.stdout)
+ p2.wait()
+ p.wait()
+ else:
+ execcmd(args, show=True)
def main():
do_command(parse_options, svn_log)