From 5e8576a48fae6e9f7a9699d57571e926d7e6e236 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 31 Aug 2009 13:16:48 -0400 Subject: Upgrade duplicate bugdirs if necessary (e.g. for `be diff'). Also moved pre-YAML mapfile handling in mapfile.parse() into upgrade.Upgrade_1_0_to_2._upgrade_mapfile(). --- libbe/mapfile.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'libbe/mapfile.py') diff --git a/libbe/mapfile.py b/libbe/mapfile.py index b959d76..74d2b1a 100644 --- a/libbe/mapfile.py +++ b/libbe/mapfile.py @@ -95,24 +95,6 @@ def parse(contents): >>> dict["e"] 'f' """ - old_format = False - for line in contents.splitlines(): - if len(line.split("=")) == 2: - old_format = True - break - if old_format: # translate to YAML. Hack to deal with old BE bugs. - newlines = [] - for line in contents.splitlines(): - line = line.rstrip('\n') - if len(line) == 0: - continue - fields = line.split("=") - if len(fields) == 2: - key,value = fields - newlines.append('%s: "%s"' % (key, value.replace('"','\\"'))) - else: - newlines.append(line) - contents = '\n'.join(newlines) return yaml.load(contents) or {} def map_save(rcs, path, map, allow_no_rcs=False): -- cgit