On 05/13/2011 03:14 PM, Michael Olbrich wrote:
Hi,

On Fri, May 13, 2011 at 12:25:49PM -0500, George McCollister wrote:
There are some more patches I think. Also, if you run format-patch with
"--start-number 525 -N", then the patch numbers match the svn revision and
adding new patches will be easier.

There isn't a one-to-one relationship between SVN revision numbers
and patches. For 92 patches there 96 svn revisions. If you want them
to match I could just make a simple script to rename the files to
match  the svn revision inside of the file.
Yes, I think I'd like that. It doesn't really look like there will be a
release soon, and this way it's easier to keep track what we already have.

Michael


Done. I've attached the quickly hacked script for future reference.
#!/usr/bin/python

import re
import os

files = [file for file in os.listdir(".") if file.startswith("0")]
svnre = re.compile('git-svn-id:.*svn\/trunk\@(\d+)')
for file in files:
	patch = open(file, "r")
	for line in patch:
		if line.startswith("git-svn-id:"):
			vmatch = svnre.match(line)
			if vmatch:
				newfile = "%04d%s" % (int(vmatch.group(1)), file[4:])
				print "svn r%s - Renaming %s to %s" % (vmatch.group(1), file, newfile)
				os.rename(file, newfile)
				break
	patch.close()
-- 
ptxdist mailing list
[email protected]

Reply via email to