]> thyrsus.com Git - src.git/commitdiff
Backend diff works.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 8 Nov 2014 17:19:53 +0000 (12:19 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 8 Nov 2014 17:19:53 +0000 (12:19 -0500)
src

diff --git a/src b/src
index f6d747c9622de43c400cf16a8d055c625b51172a..7ea09188c92358d0d0e1e4c94df6552fb730f2f7 100755 (executable)
--- a/src
+++ b/src
@@ -527,16 +527,15 @@ def diff_method(*args):
     while args and args[0].startswith("-"):
         diffopts += " " + args.pop(0)
     for arg in args:
-        diffspec = ""
+        diffspec1 = diffspec2 = ""
         if revspec is not None:
             master = History(arg)
             revspec = master.resolve(revspec)
-            diffspec += "-r" + master.revno_to_rcs(revspec[0])
+            diffspec1 += master.revno_to_rcs(revspec[0])
             if len(revspec) > 1:
-                diffspec += " -r" + master.revno_to_rcs(revspec[1])
+                diffspec2 += master.revno_to_rcs(revspec[1])
         with lifted(arg):
-            # The || : suppresses the error return from diff(1)
-            do_or_die("rcsdiff -q {0} {1} {2} || :".format(diffspec, diffopts, arg),loud=True)
+            backend.diff(diffspec1, diffspec2, diffopts, arg)
 
 def list_tags(*args):
     (revspec, args) = preamble("tag", args)
@@ -778,6 +777,15 @@ class RCS:
         "Copy a file and its history to a target directory."
         # Using cp(1) evades cross-filesystem issues
         do_or_die("cp {0} {1} && cp {2} {3]/{4}".format(arg, target, self.master(arg), target, repodir)) 
+    def diff(diffspec1, diffspec2, diffopts, arg):
+        "Report a diff."
+        # The || : suppresses the error return from diff(1)
+        if diffspec1:
+            diffspec1 = "-r" + diffspec1
+        if diffspec2:
+            diffspec2 = "-r" + diffspec1
+        do_or_die("rcsdiff -q {0} {1} {2} || :".format(diffspec, diffopts, arg),loud=True)
+
 
 if __name__ == "__main__":    
     command = list(sys.argv[1:])