change log() to return the string instead of printing it

This commit is contained in:
Guido van Rossum 1995-10-07 19:46:08 +00:00
parent 83d6bbf597
commit bffda89914
1 changed files with 5 additions and 4 deletions

View File

@ -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"""