[prev in list] [next in list] [prev in thread] [next in thread]
List: svnmerge
Subject: [Svnmerge] patch: ignore corrupt entries
From: Benjamin Reed <rangerrick () gmail ! com>
Date: 2009-05-19 21:35:47
Message-ID: 57eba2250905191435h44708871ydc23770266992698 () mail ! gmail ! com
[Download RAW message or body]
I ran into a problem where we had some hand-edited svnmerge-integrated
properties in our repository. Since svnmerge evaluate entries in old
revisions, there's no way (without archive surgery) to retroactively
change a busted svnmerge-integrated property.
Instead, I made a small patch to svnmerge.py to accept the option
"--ignore-corrupt-entries" where it will ignore the broken entries,
rather than bomb out with a cryptic "svnmerge: Invalid path identifier
''" message.
I apologize if I've failed at python-isms, I haven't dabbled in python
for probably 5 years, but I muddled through to something that behaved
right for me. I hope this would be accepted for what it is: a total
hack. ;)
Attached is the patch to current svnmerge.py trunk.
--
Benjamin Reed a.k.a. Ranger Rick
Fink, KDE, and Mac OS X development
Blog: http://www.raccoonfink.com/
Music: http://music.raccoonfink.com/
["svnmerge-ignore-corrupt-entries.patch" (application/octet-stream)]
--- svnmerge.py.orig 2009-05-19 17:32:30.000000000 -0400
+++ svnmerge.py 2009-05-15 16:57:20.000000000 -0400
@@ -399,8 +399,11 @@
# we can only cache this by repo-relative path
PathIdentifier.locobjs[pathid_str] = pathid
else:
- error("Invalid path identifier '%s'" % pathid_str)
- return PathIdentifier.locobjs[pathid_str]
+ if not opts["ignore-corrupt-entries"]:
+ error("Invalid path identifier '%s'" % pathid_str)
+ if PathIdentifier.locobjs.has_key(pathid_str):
+ return PathIdentifier.locobjs[pathid_str]
+ return None
from_pathid = staticmethod(from_pathid)
def from_target(target):
@@ -838,9 +841,9 @@
pathid = PathIdentifier.from_pathid(pathid_str)
# cache the "external" form we saw
- pathid.external_form = pathid_str
-
- prop[pathid] = revs
+ if pathid:
+ pathid.external_form = pathid_str
+ prop[pathid] = revs
return prop
def get_revlist_prop(url_or_dir, propname, rev=None):
@@ -2027,6 +2030,8 @@
"implies --show-changes"),
Option("-s", "--show-changes",
help="show subversion commands that make changes"),
+ Option("-i", "--ignore-corrupt-entries",
+ help="ignore corrupt svnmerge indexes"),
Option("-v", "--verbose",
help="verbose mode: output more information about progress"),
OptionArg("-u", "--username",
@@ -2038,6 +2043,7 @@
OptionArg("-c", "--config-dir", metavar="DIR",
default=None,
help="cause subversion commands to consult runtime config directory DIR"),
+
]
common_opts = [
_______________________________________________
Svnmerge mailing list
Svnmerge@orcaware.com
http://www.orcaware.com/mailman/listinfo/svnmerge
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic