Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Aug 2000 16:06:28 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        imp@village.org
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/games/fortune/datfiles fortunes 
Message-ID:  <20000808160628T.simokawa@sat.t.u-tokyo.ac.jp>
In-Reply-To: <200008072226.QAA35123@harmony.village.org>
References:  <200008072049.NAA00374@freefall.freebsd.org> <200008072201.QAA34941@harmony.village.org> <200008072226.QAA35123@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Warner Losh <imp@village.org>
Subject: Re: cvs commit: src/games/fortune/datfiles fortunes 
Date: Mon, 07 Aug 2000 16:26:35 -0600
Message-ID: <200008072226.QAA35123@harmony.village.org>

imp> In message <20000807171632.B514@FreeBSD.org> Ade Lovett writes:
imp> : http://www.FreeBSD.org/cgi/cvsweb.cgi/src/games/fortune/datfiles/fortunes.diff?r1=1.41&r2=1.42
imp> 
imp> I'd love to see links like this in the commit message :-)
imp> 
imp> Warner

I use the following python script to get diff by cut&paste from
interesting commit messages.

#!/usr/local/bin/python
#
# fetch diff via cvsweb while reading commit messages 
#
# example input:
#   1.12      +2 -1      doc/share/sgml/man-refs.ent 

import re,urllib,sys,string

repo_list = {
	# repository	URL					cvsroot
	"freebsd" : ("http://www.freebsd.org/cgi/cvsweb.cgi", "freebsd"),
	"freebsd-jp" : ("http://www.jp.freebsd.org/cgi/cvsweb",  "freebsd-jp"),
}
repo = "freebsd"
pat = re.compile("([\d.]+)\.(\d+)\s+\+\d+ -\d+\s+([^\s]+)")

def process_line(i, url, cvsroot):
	match = pat.search(i)
	if match:
		major, minor, lpath = match.groups()
		minor = int(minor)
		if minor == 1: # branch point
			r1 = major[:string.rfind(major, ".")]
		else:
			r1 = "%s.%d" % (major, minor - 1)
		r2 = "%s.%d" % (major, minor)
		path = "%s/%s?r1=%s&r2=%s&cvsroot=%s" % (
			url, lpath, r1, r2, cvsroot)
		print path
		f = urllib.urlopen(path)
		for j in f.readlines():
			sys.stdout.write(j)
		f.close()
		print "=" * 68

if __name__ == "__main__":
	if len(sys.argv) > 1:
		repo = sys.argv.pop(1)	
	url, cvsroot = repo_list[repo]
	while 1:
		l = sys.stdin.readline()
		if l:
			process_line(l, url, cvsroot)
		else:
			break


/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000808160628T.simokawa>