summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-10-07 19:46:08 (GMT)
committerGuido van Rossum <guido@python.org>1995-10-07 19:46:08 (GMT)
commitbffda899142f24b88563bc7e147f5d80621185e1 (patch)
tree208e3e24181692f7d26c64a6f81f19a3eddc95d0 /Demo
parent83d6bbf5974adcb3292c4f498651c073db306b8b (diff)
downloadcpython-bffda899142f24b88563bc7e147f5d80621185e1.zip
cpython-bffda899142f24b88563bc7e147f5d80621185e1.tar.gz
cpython-bffda899142f24b88563bc7e147f5d80621185e1.tar.bz2
change log() to return the string instead of printing it
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/pdist/rcslib.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py
index 7c68543..4b34fd7 100755
--- a/Demo/pdist/rcslib.py
+++ b/Demo/pdist/rcslib.py
@@ -46,14 +46,15 @@ class RCS:
# --- 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"""