Kaydet (Commit) bffda899 authored tarafından Guido van Rossum's avatar Guido van Rossum

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

üst 83d6bbf5
...@@ -46,14 +46,15 @@ class RCS: ...@@ -46,14 +46,15 @@ class RCS:
# --- Informational methods about a single file/revision --- # --- Informational methods about a single file/revision ---
def log(self, name_rev, otherflags = ''): 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. Optional OTHERFLAGS are passed to rlog.
""" """
name, rev = self.checkfile(name_rev) f = self._open(name_rev, 'rlog ' + otherflags)
cmd = "rlog -r%s %s %s" % (rev, name, otherflags) data = f.read()
return self._system(cmd) self._closepipe(f)
return data
def head(self, name_rev): def head(self, name_rev):
"""Return the head revision for NAME_REV""" """Return the head revision for NAME_REV"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment