Kaydet (Commit) a6e02e84 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Conservatively restrict support to format 8 repositories.

üst 49ac5aa2
...@@ -33,27 +33,29 @@ and for a file with a binary mime-type property: ...@@ -33,27 +33,29 @@ and for a file with a binary mime-type property:
import re import re
import os import os
def propfile(root, fn): def propfiles(root, fn):
default = os.path.join(root, ".svn", "props", fn+".svn-work") default = os.path.join(root, ".svn", "props", fn+".svn-work")
try: try:
format = int(open(os.path.join(root, ".svn", "format")).read().strip()) format = int(open(os.path.join(root, ".svn", "format")).read().strip())
except IOError: except IOError:
return default return []
# XXX I don't know what version uses what format; if format == 8:
# this condition is just anecdotal # In version 8, committed props are stored in prop-base,
if format >= 8: # local modifications in props
return os.path.join(root, ".svn", "prop-base", fn+".svn-base") return [os.path.join(root, ".svn", "prop-base", fn+".svn-base"),
return default os.path.join(root, ".svn", "props", fn+".svn-work")]
raise ValueError, "Unknown repository format"
def proplist(root, fn): def proplist(root, fn):
"Return a list of property names for file fn in directory root" "Return a list of property names for file fn in directory root"
path = propfile(root, fn) result = []
for path in propfiles(root, fn):
try: try:
f = open(path) f = open(path)
except IOError: except IOError:
# no properties file: not under version control # no properties file: not under version control,
return [] # or no properties set
result = [] continue
while 1: while 1:
# key-value pairs, of the form # key-value pairs, of the form
# K <length> # K <length>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment