]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
change log() to return the string instead of printing it
authorGuido van Rossum <guido@python.org>
Sat, 7 Oct 1995 19:46:08 +0000 (19:46 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 7 Oct 1995 19:46:08 +0000 (19:46 +0000)
Demo/pdist/rcslib.py

index 7c685430ee41b4cee993ed26535c4e9f7987c3b2..4b34fd76489d401a07cc8e92ecc3ebf954a53333 100755 (executable)
@@ -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"""