From bffda899142f24b88563bc7e147f5d80621185e1 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 7 Oct 1995 19:46:08 +0000 Subject: [PATCH] change log() to return the string instead of printing it --- Demo/pdist/rcslib.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py index 7c685430ee4..4b34fd76489 100755 --- a/Demo/pdist/rcslib.py +++ b/Demo/pdist/rcslib.py @@ -46,14 +46,15 @@ def __del__(self): # --- Informational methods about a single file/revision --- def log(self, name_rev, otherflags = ''): - """Print the full log text for NAME_REV on stdout. + """Return the full log text for NAME_REV as a string. Optional OTHERFLAGS are passed to rlog. """ - name, rev = self.checkfile(name_rev) - cmd = "rlog -r%s %s %s" % (rev, name, otherflags) - return self._system(cmd) + f = self._open(name_rev, 'rlog ' + otherflags) + data = f.read() + self._closepipe(f) + return data def head(self, name_rev): """Return the head revision for NAME_REV"""