Revision: 941
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=941&view=rev
Author: pronovic
Date: 2009-03-29 19:49:00 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Fix sorrtags so it only pays attention to the proper tags
Modified Paths:
--------------
cedar-backup2/trunk/util/sorttags.py
Modified: cedar-backup2/trunk/util/sorttags.py
===================================================================
--- cedar-backup2/trunk/util/sorttags.py 2009-03-29 19:48:33 UTC (rev 940)
+++ cedar-backup2/trunk/util/sorttags.py 2009-03-29 19:49:00 UTC (rev 941)
@@ -11,16 +11,19 @@
def numify(x):
"""Numify a 'svn list --verbose' line, extracting the version and making it into a float."""
- x = re.sub("^.*CEDAR_BACKUP2_V", "", x)
- x = re.sub("/", "", x)
- x = re.sub("\n", "", x)
- components = x.split(".")
- numified = components[0]
- numified += "."
- for component in components[1:]:
- component = re.sub("[^0-9].*$", "", component)
- numified += "%03d" % int(component)
- return float(numified)
+ if re.match("^.*CEDAR_BACKUP2_V", x):
+ x = re.sub("^.*CEDAR_BACKUP2_V", "", x)
+ x = re.sub("/", "", x)
+ x = re.sub("\n", "", x)
+ components = x.split(".")
+ print components
+ numified = components[0]
+ numified += "."
+ for component in components[1:]:
+ component = re.sub("[^0-9].*$", "", component)
+ numified += "%03d" % int(component)
+ return float(numified)
+ return 0 # ignore the line if we can't parse it
lines = sys.stdin.readlines()
lines.sort(compare)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|