# HG changeset patch # User Matt Mackall # Date 2011-06-16 18:24:44 # Node ID fdcdb221a9222a1d7a9fe0b7204e0986e7944434 # Parent f2789767a2c4d40de341c3fc6b460608b7c8c008 config: handle comment lines in continuations (issue2854) diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -74,7 +74,8 @@ class config(object): sectionre = re.compile(r'\[([^\[]+)\]') itemre = re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)') contre = re.compile(r'\s+(\S|\S.*\S)\s*$') - emptyre = re.compile(r'(;|#|\s*$)') + emptyre = re.compile(r'\s*(;|#|\s*$)') + commentre = re.compile(r'(;|#)') unsetre = re.compile(r'%unset\s+(\S+)') includere = re.compile(r'%include\s+(\S|\S.*\S)\s*$') section = "" @@ -85,6 +86,8 @@ class config(object): for l in data.splitlines(True): line += 1 if cont: + if commentre.match(l): + continue m = contre.match(l) if m: if sections and section not in sections: